+2001-06-15 Paul Eggert <eggert@twinsun.com>
+
+ * doc/autoconf.texi: Move AC_FUNC_WAIT3 and
+ AC_SYS_RESTARTABLE_SYSCALLS to the obsolete section,
+ and explain why and how to replace them.
+ * acfunctions.m4 (AC_FUNC_WAIT3): Warn as obsolete.
+ * acspecific.m4 (AC_SYS_RESTARTABLE_SYSCALLS): Likewise.
+
2001-06-15 Akim Demaille <akim@epita.fr>
`build_alias' and so on are not AC_SUBST'd.
** Specific Macros
- AC_PATH_XTRA only adds -ldnet to $LIBS if it's needed to link.
+- AC_FUNC_WAIT3 and AC_SYS_RESTARTABLE_SYSCALLS are obsoleted.
\f
* Major changes in Autoconf 2.50
# AC_FUNC_WAIT3
# -------------
AC_DEFUN([AC_FUNC_WAIT3],
-[AC_CACHE_CHECK(for wait3 that fills in rusage, ac_cv_func_wait3_rusage,
+[AC_DIAGNOSE([obsolete],
+[$0: `wait3' is being removed from the Open Group standards.
+Remove this `AC_FUNC_WAIT3' and adjust your code to use `waitpid' instead.])dnl
+AC_CACHE_CHECK(for wait3 that fills in rusage, ac_cv_func_wait3_rusage,
[AC_TRY_RUN(
[#include <sys/types.h>
#include <sys/time.h>
# If the system automatically restarts a system call that is
# interrupted by a signal, define `HAVE_RESTARTABLE_SYSCALLS'.
AC_DEFUN([AC_SYS_RESTARTABLE_SYSCALLS],
-[AC_REQUIRE([AC_HEADER_SYS_WAIT])dnl
+[AC_DIAGNOSE([obsolete],
+[$0: System call restartability is now typically set at runtime.
+Remove this `AC_SYS_RESTARTABLE_SYSCALLS'
+and adjust your code to use `sigaction' with `SA_RESTART' instead.])dnl
+AC_REQUIRE([AC_HEADER_SYS_WAIT])dnl
AC_CHECK_HEADERS(unistd.h)
AC_CACHE_CHECK(for restartable system calls, ac_cv_sys_restartable_syscalls,
[AC_RUN_IFELSE([AC_LANG_SOURCE(
are also available.)
@end defmac
-@defmac AC_FUNC_WAIT3
-@maindex FUNC_WAIT3
-@cvindex HAVE_WAIT3
-If @code{wait3} is found and fills in the contents of its third argument
-(a @samp{struct rusage *}), which HP-UX does not do, define
-@code{HAVE_WAIT3}.
-@end defmac
-
@node Generic Functions, , Particular Functions, Library Functions
@subsection Generic Function Checks
@samp{yes}. If not, set the variable to @samp{no}.
@end defmac
-@defmac AC_SYS_RESTARTABLE_SYSCALLS
-@maindex SYS_RESTARTABLE_SYSCALLS
-@cvindex HAVE_RESTARTABLE_SYSCALLS
-If the system automatically restarts a system call that is interrupted
-by a signal, define @code{HAVE_RESTARTABLE_SYSCALLS}. This macro does
-not check if system calls are restarted in general--it tests whether a
-signal handler installed with @code{signal} (but not @code{sigaction})
-causes system calls to be restarted. It does not test if system calls
-can be restarted when interrupted by signals that have no handler.
-@end defmac
-
@node UNIX Variants, , System Services, Existing Tests
@section UNIX Variants
@code{AC_CHECK_FUNC}
@end defmac
+@defmac AC_FUNC_WAIT3
+@maindex FUNC_WAIT3
+@cvindex HAVE_WAIT3
+If @code{wait3} is found and fills in the contents of its third argument
+(a @samp{struct rusage *}), which HP-UX does not do, define
+@code{HAVE_WAIT3}.
+
+These days portable programs should use @code{waitpid}, not
+@code{wait3}, as @code{wait3} is being removed from the Open Group
+standards, and will not appear in the next revision of POSIX.
+@end defmac
+
@defmac AC_GCC_TRADITIONAL
@maindex GCC_TRADITIONAL
@code{AC_PROG_GCC_TRADITIONAL}
@code{AC_STRUCT_ST_RDEV}
@end defmac
+@defmac AC_SYS_RESTARTABLE_SYSCALLS
+@maindex SYS_RESTARTABLE_SYSCALLS
+@cvindex HAVE_RESTARTABLE_SYSCALLS
+If the system automatically restarts a system call that is interrupted
+by a signal, define @code{HAVE_RESTARTABLE_SYSCALLS}. This macro does
+not check if system calls are restarted in general--it tests whether a
+signal handler installed with @code{signal} (but not @code{sigaction})
+causes system calls to be restarted. It does not test if system calls
+can be restarted when interrupted by signals that have no handler.
+
+These days portable programs should use @code{sigaction} with
+@code{SA_RESTART} if they want restartable system calls. They should
+not rely on @code{HAVE_RESTARTABLE_SYSCALLS}, since nowadays whether a
+system call is restartable is a dynamic issue, not a configuration-time
+issue.
+@end defmac
+
@defmac AC_SYS_SIGLIST_DECLARED
@maindex SYS_SIGLIST_DECLARED
@code{AC_DECL_SYS_SIGLIST}
# AC_FUNC_WAIT3
# -------------
AC_DEFUN([AC_FUNC_WAIT3],
-[AC_CACHE_CHECK(for wait3 that fills in rusage, ac_cv_func_wait3_rusage,
+[AC_DIAGNOSE([obsolete],
+[$0: `wait3' is being removed from the Open Group standards.
+Remove this `AC_FUNC_WAIT3' and adjust your code to use `waitpid' instead.])dnl
+AC_CACHE_CHECK(for wait3 that fills in rusage, ac_cv_func_wait3_rusage,
[AC_TRY_RUN(
[#include <sys/types.h>
#include <sys/time.h>
# If the system automatically restarts a system call that is
# interrupted by a signal, define `HAVE_RESTARTABLE_SYSCALLS'.
AC_DEFUN([AC_SYS_RESTARTABLE_SYSCALLS],
-[AC_REQUIRE([AC_HEADER_SYS_WAIT])dnl
+[AC_DIAGNOSE([obsolete],
+[$0: System call restartability is now typically set at runtime.
+Remove this `AC_SYS_RESTARTABLE_SYSCALLS'
+and adjust your code to use `sigaction' with `SA_RESTART' instead.])dnl
+AC_REQUIRE([AC_HEADER_SYS_WAIT])dnl
AC_CHECK_HEADERS(unistd.h)
AC_CACHE_CHECK(for restartable system calls, ac_cv_sys_restartable_syscalls,
[AC_RUN_IFELSE([AC_LANG_SOURCE(