Separate the module 'waitpid' from the module 'sys_wait'.
authorBruno Haible <bruno@clisp.org>
Wed, 29 Sep 2010 14:14:55 +0000 (16:14 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 29 Sep 2010 14:14:55 +0000 (16:14 +0200)
* lib/sys_wait.in.h (waitpid): Declare only if the 'waitpid' module is
present.
* m4/sys_wait_h.m4 (gl_SYS_WAIT_MODULE_INDICATOR): Invoke
gl_MODULE_INDICATOR_FOR_TESTS.
(gl_SYS_WAIT_H_DEFAULTS): Initialize GNULIB_WAITPID.
* modules/sys_wait (Depends-on): Remove waitpid.
(Makefile.am): Substitute GNULIB_WAITPID.
* modules/waitpid (configure.ac): Invoke gl_SYS_WAIT_MODULE_INDICATOR.
* tests/test-sys_wait-c++.cc (GNULIB_NAMESPACE::waitpid): Check the
signature only if the 'waitpid' module is present.
* doc/posix-functions/waitpid.texi: Mention the 'waitpid' module.
* NEWS: Mention the change.
* modules/grantpt (Depends-on): Add waitpid.
* modules/wait-process (Depends-on): Likewise.

ChangeLog
NEWS
doc/posix-functions/waitpid.texi
lib/sys_wait.in.h
m4/sys_wait_h.m4
modules/grantpt
modules/sys_wait
modules/wait-process
modules/waitpid
tests/test-sys_wait-c++.cc

index 613fe00..7fdc713 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,23 @@
 2010-09-29  Bruno Haible  <bruno@clisp.org>
 
+       Separate the module 'waitpid' from the module 'sys_wait'.
+       * lib/sys_wait.in.h (waitpid): Declare only if the 'waitpid' module is
+       present.
+       * m4/sys_wait_h.m4 (gl_SYS_WAIT_MODULE_INDICATOR): Invoke
+       gl_MODULE_INDICATOR_FOR_TESTS.
+       (gl_SYS_WAIT_H_DEFAULTS): Initialize GNULIB_WAITPID.
+       * modules/sys_wait (Depends-on): Remove waitpid.
+       (Makefile.am): Substitute GNULIB_WAITPID.
+       * modules/waitpid (configure.ac): Invoke gl_SYS_WAIT_MODULE_INDICATOR.
+       * tests/test-sys_wait-c++.cc (GNULIB_NAMESPACE::waitpid): Check the
+       signature only if the 'waitpid' module is present.
+       * doc/posix-functions/waitpid.texi: Mention the 'waitpid' module.
+       * NEWS: Mention the change.
+       * modules/grantpt (Depends-on): Add waitpid.
+       * modules/wait-process (Depends-on): Likewise.
+
+2010-09-29  Bruno Haible  <bruno@clisp.org>
+
        More tests for module 'sys_wait'.
        * modules/sys_wait-c++-tests: New file.
        * tests/test-sys_wait-c++.cc: New file.
diff --git a/NEWS b/NEWS
index 377898d..2f03ac1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,10 @@ User visible incompatible changes
 
 Date        Modules         Changes
 
+2010-09-29  sys_wait        This module no longer provides the waitpid()
+                            function. If you need this function, you now need
+                            to request the 'waitpid' module.
+
 2010-09-17  utimens         The function gl_futimens is removed, and its
                             signature has been migrated to fdutimens.  Callers
                             of gl_futimens should change function name, and
index 71a4676..9c68150 100644 (file)
@@ -4,15 +4,15 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/waitpid.html}
 
-Gnulib module: ---
+Gnulib module: waitpid
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function is missing on some platforms:
+mingw.
 @end itemize
 
 Portability problems not fixed by Gnulib:
 @itemize
-@item
-This function is missing on some platforms:
-mingw.
 @end itemize
index 6f0ef36..727657c 100644 (file)
@@ -113,7 +113,7 @@ extern "C" {
 
 /* Declarations of functions.  */
 
-#if 1 /* @GNULIB_WAITPID@ */
+#if @GNULIB_WAITPID@
 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 _GL_FUNCDECL_SYS (waitpid, pid_t, (pid_t pid, int *statusp, int options));
 # endif
index dd44581..63e1d21 100644 (file)
@@ -22,9 +22,12 @@ AC_DEFUN([gl_SYS_WAIT_MODULE_INDICATOR],
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS])
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
 AC_DEFUN([gl_SYS_WAIT_H_DEFAULTS],
 [
+  GNULIB_WAITPID=0; AC_SUBST([GNULIB_WAITPID])
   dnl Assume proper GNU behavior unless another module says otherwise.
 ])
index 4a2e168..a5d9eb4 100644 (file)
@@ -9,6 +9,7 @@ Depends-on:
 stdlib
 extensions
 pt_chown
+waitpid
 configmake
 
 configure.ac:
index 2c82029..01f995e 100644 (file)
@@ -9,7 +9,6 @@ Depends-on:
 c++defs
 include_next
 warn-on-use
-waitpid
 
 configure.ac:
 gl_SYS_WAIT_H
@@ -27,6 +26,7 @@ sys/wait.h: sys_wait.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \
+             -e 's|@''GNULIB_WAITPID''@|$(GNULIB_WAITPID)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/sys_wait.in.h; \
index 0670bda..9120bbc 100644 (file)
@@ -17,6 +17,7 @@ stdbool
 sys_wait
 unistd
 atexit
+waitpid
 
 configure.ac:
 gl_WAIT_PROCESS
index f8fbf0f..f9699c6 100644 (file)
@@ -10,6 +10,7 @@ sys_wait
 
 configure.ac:
 gl_FUNC_WAITPID
+gl_SYS_WAIT_MODULE_INDICATOR([waitpid])
 
 Makefile.am:
 
index 6216375..692e195 100644 (file)
@@ -24,7 +24,9 @@
 #include "signature.h"
 
 
+#if GNULIB_TEST_WAITPID
 SIGNATURE_CHECK (GNULIB_NAMESPACE::waitpid, pid_t, (pid_t, int *, int));
+#endif
 
 
 int