bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AC_FUNC_WAIT3 and AC_SYS_RESTARTABLE_SYSCALLS are obsolete


From: Paul Eggert
Subject: AC_FUNC_WAIT3 and AC_SYS_RESTARTABLE_SYSCALLS are obsolete
Date: Wed, 13 Jun 2001 08:53:41 -0700 (PDT)

The autoconf macros AC_FUNC_WAIT3 and AC_SYS_RESTARTABLE_SYSCALLS are
obsolete, and should be marked as such.

* Nobody uses AC_FUNC_WAIT3 anymore.  Well, that's not quite true: I
  just checked all the GNU programs we have here, and Bash uses
  AC_FUNC_WAIT3; but it invokes AC_CHECK_FUNC(wait3,
  AC_DEFINE(HAVE_WAIT3)) after invoking AC_FUNC_WAIT3, which means that
  the AC_FUNC_WAIT3 call is superfluous.

  These days portable programs should use waitpid, not wait3.  wait3 is
  being removed from the Open Group standards.  It won't appear in the
  next revision of POSIX.

* Similarly, I just checked all the GNU programs we use around here,
  and only Bash uses AC_SYS_RESTARTABLE_SYSCALLS, and it uses it
  incorrectly.  The result of AC_SYS_RESTARTABLE_SYSCALLS has no
  effect on Bash.

  These days portable programs should use SA_RESTART if they want
  restartable system calls; they should not rely on
  AC_SYS_RESTARTABLE_SYSCALLS, since nowadays the question as to
  whether a system call is restartable is a dynamic one, not a
  configuration-time one.

Here is a patch:

2001-06-13  Paul Eggert  <address@hidden>

        * 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.

===================================================================
RCS file: doc/autoconf.texi,v
retrieving revision 2.50.0.2
retrieving revision 2.50.0.3
diff -pu -r2.50.0.2 -r2.50.0.3
--- doc/autoconf.texi   2001/06/01 21:53:49     2.50.0.2
+++ doc/autoconf.texi   2001/06/13 15:35:25     2.50.0.3
@@ -3475,14 +3475,6 @@ is available, you may assume that @code{
 are also available.)
 @end defmac
 
address@hidden AC_FUNC_WAIT3
address@hidden FUNC_WAIT3
address@hidden 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
address@hidden
address@hidden defmac
-
 @node Generic Functions,  , Particular Functions, Library Functions
 @subsection Generic Function Checks
 
@@ -4752,17 +4744,6 @@ system.  If so, set the shell variable @
 @samp{yes}.  If not, set the variable to @samp{no}.
 @end defmac
 
address@hidden AC_SYS_RESTARTABLE_SYSCALLS
address@hidden SYS_RESTARTABLE_SYSCALLS
address@hidden 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.
address@hidden defmac
-
 @node UNIX Variants,  , System Services, Existing Tests
 @section UNIX Variants
 
@@ -9460,6 +9441,18 @@ and sets @code{EMXOS2}.
 @code{AC_CHECK_FUNC}
 @end defmac
 
address@hidden AC_FUNC_WAIT3
address@hidden FUNC_WAIT3
address@hidden 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
address@hidden
+
+These days portable programs should use @code{waitpid}, not
address@hidden, as @code{wait3} is being removed from the Open Group
+standards, and will not appear in the next revision of POSIX.
address@hidden defmac
+
 @defmac AC_GCC_TRADITIONAL
 @maindex GCC_TRADITIONAL
 @code{AC_PROG_GCC_TRADITIONAL}
@@ -9865,6 +9858,23 @@ now it just calls @code{AC_FUNC_STRFTIME
 @code{AC_STRUCT_ST_RDEV}
 @end defmac
 
address@hidden AC_SYS_RESTARTABLE_SYSCALLS
address@hidden SYS_RESTARTABLE_SYSCALLS
address@hidden 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
address@hidden 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.
address@hidden defmac
+
 @defmac AC_SYS_SIGLIST_DECLARED
 @maindex SYS_SIGLIST_DECLARED
 @code{AC_DECL_SYS_SIGLIST}
===================================================================
RCS file: acfunctions.m4,v
retrieving revision 2.50
retrieving revision 2.50.0.1
diff -pu -r2.50 -r2.50.0.1
--- acfunctions.m4      2001/04/24 08:22:01     2.50
+++ acfunctions.m4      2001/06/13 15:35:25     2.50.0.1
@@ -1577,7 +1577,10 @@ AU_ALIAS([AC_VPRINTF], [AC_FUNC_VPRINTF]
 # 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>
===================================================================
RCS file: acspecific.m4,v
retrieving revision 2.50
retrieving revision 2.50.0.1
diff -pu -r2.50 -r2.50.0.1
--- acspecific.m4       2001/04/17 13:12:03     2.50
+++ acspecific.m4       2001/06/13 15:35:25     2.50.0.1
@@ -494,7 +494,11 @@ fi
 # 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(



reply via email to

[Prev in Thread] Current Thread [Next in Thread]