From 77a06aac2187e2ea13e5b7aa8e30d46a81ca45f8 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 29 Sep 2010 16:14:55 +0200 Subject: [PATCH] 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. --- ChangeLog | 18 ++++++++++++++++++ NEWS | 4 ++++ doc/posix-functions/waitpid.texi | 8 ++++---- lib/sys_wait.in.h | 2 +- m4/sys_wait_h.m4 | 3 +++ modules/grantpt | 1 + modules/sys_wait | 2 +- modules/wait-process | 1 + modules/waitpid | 1 + tests/test-sys_wait-c++.cc | 2 ++ 10 files changed, 36 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 613fe003a..7fdc71315 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,23 @@ 2010-09-29 Bruno Haible + 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 + 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 377898dcb..2f03ac139 100644 --- 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 diff --git a/doc/posix-functions/waitpid.texi b/doc/posix-functions/waitpid.texi index 71a4676fc..9c68150d8 100644 --- a/doc/posix-functions/waitpid.texi +++ b/doc/posix-functions/waitpid.texi @@ -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 diff --git a/lib/sys_wait.in.h b/lib/sys_wait.in.h index 6f0ef3687..727657cf2 100644 --- a/lib/sys_wait.in.h +++ b/lib/sys_wait.in.h @@ -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 diff --git a/m4/sys_wait_h.m4 b/m4/sys_wait_h.m4 index dd44581d5..63e1d21e4 100644 --- a/m4/sys_wait_h.m4 +++ b/m4/sys_wait_h.m4 @@ -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. ]) diff --git a/modules/grantpt b/modules/grantpt index 4a2e16809..a5d9eb403 100644 --- a/modules/grantpt +++ b/modules/grantpt @@ -9,6 +9,7 @@ Depends-on: stdlib extensions pt_chown +waitpid configmake configure.ac: diff --git a/modules/sys_wait b/modules/sys_wait index 2c8202971..01f995e87 100644 --- a/modules/sys_wait +++ b/modules/sys_wait @@ -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; \ diff --git a/modules/wait-process b/modules/wait-process index 0670bda86..9120bbcf0 100644 --- a/modules/wait-process +++ b/modules/wait-process @@ -17,6 +17,7 @@ stdbool sys_wait unistd atexit +waitpid configure.ac: gl_WAIT_PROCESS diff --git a/modules/waitpid b/modules/waitpid index f8fbf0f76..f9699c6c5 100644 --- a/modules/waitpid +++ b/modules/waitpid @@ -10,6 +10,7 @@ sys_wait configure.ac: gl_FUNC_WAITPID +gl_SYS_WAIT_MODULE_INDICATOR([waitpid]) Makefile.am: diff --git a/tests/test-sys_wait-c++.cc b/tests/test-sys_wait-c++.cc index 6216375d6..692e19524 100644 --- a/tests/test-sys_wait-c++.cc +++ b/tests/test-sys_wait-c++.cc @@ -24,7 +24,9 @@ #include "signature.h" +#if GNULIB_TEST_WAITPID SIGNATURE_CHECK (GNULIB_NAMESPACE::waitpid, pid_t, (pid_t, int *, int)); +#endif int -- 2.11.0