New module 'system-posix'.
authorBruno Haible <bruno@clisp.org>
Sat, 2 Oct 2010 09:44:20 +0000 (11:44 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 2 Oct 2010 09:44:20 +0000 (11:44 +0200)
* modules/system-posix: New file.
* lib/stdlib.in.h: Include <sys/wait.h> only when the 'system-posix'
module is present.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize
GNULIB_SYSTEM_POSIX.
* modules/stdlib (Depends-on): Remove sys_wait.
(Makefile.am): Substitute GNULIB_SYSTEM_POSIX.
* doc/posix-functions/system.texi: Mention the new module.
* doc/posix-headers/stdlib.texi: Likewise.
* tests/test-stdlib.c: If GNULIB_TEST_SYSTEM_POSIX is not defined,
define test_sys_wait_macros to a no-op.
Reported by Sam Steingold <sds@gnu.org>.

ChangeLog
doc/posix-functions/system.texi
doc/posix-headers/stdlib.texi
lib/stdlib.in.h
m4/stdlib_h.m4
modules/stdlib
modules/system-posix [new file with mode: 0644]
tests/test-stdlib.c

index 6b15b1c..361d1f3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2010-10-02  Bruno Haible  <bruno@clisp.org>
+
+       New module 'system-posix'.
+       * modules/system-posix: New file.
+       * lib/stdlib.in.h: Include <sys/wait.h> only when the 'system-posix'
+       module is present.
+       * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize
+       GNULIB_SYSTEM_POSIX.
+       * modules/stdlib (Depends-on): Remove sys_wait.
+       (Makefile.am): Substitute GNULIB_SYSTEM_POSIX.
+       * doc/posix-functions/system.texi: Mention the new module.
+       * doc/posix-headers/stdlib.texi: Likewise.
+       * tests/test-stdlib.c: If GNULIB_TEST_SYSTEM_POSIX is not defined,
+       define test_sys_wait_macros to a no-op.
+       Reported by Sam Steingold <sds@gnu.org>.
+
 2010-09-30  Bruno Haible  <bruno@clisp.org>
 
        More renaming from 'getdate' to 'get_date'.
index 30622a3..efeab40 100644 (file)
@@ -4,10 +4,16 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/system.html}
 
-Gnulib module: ---
+Gnulib module: system-posix
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+The macros @code{WIFSIGNALED}, @code{WIFEXITED}, @code{WIFSTOPPED},
+@code{WTERMSIG}, @code{WEXITSTATUS}, @code{WNOHANG}, @code{WUNTRACED},
+@code{WSTOPSIG} are not defined in @code{<stdlib.h>} (only in
+@code{<sys/wait.h>}) on some platforms:
+MirBSD 10.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 0c164d5..2c3a074 100644 (file)
@@ -3,9 +3,9 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/susv3xbd/stdlib.h.html}
 
-Gnulib module: stdlib
+Gnulib module: stdlib, system-posix
 
-Portability problems fixed by Gnulib:
+Portability problems fixed by the Gnulib module @code{stdlib}:
 @itemize
 @item
 The macros @code{EXIT_SUCCESS} and @code{EXIT_FAILURE} are not defined on
@@ -17,7 +17,10 @@ The macro @code{EXIT_FAILURE} is incorrectly defined on Tandem/NSK.
 Some platforms provide a @code{NULL} macro that cannot be used in arbitrary
 expressions:
 NetBSD 5.0
+@end itemize
 
+Portability problems fixed by the Gnulib module @code{system-posix}:
+@itemize
 @item
 The macros @code{WIFSIGNALED}, @code{WIFEXITED}, @code{WIFSTOPPED},
 @code{WTERMSIG}, @code{WEXITSTATUS}, @code{WNOHANG}, @code{WUNTRACED},
index f4309ed..de13bf7 100644 (file)
@@ -39,7 +39,7 @@
 #include <stddef.h>
 
 /* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>.  */
-#ifndef WEXITSTATUS
+#if @GNULIB_SYSTEM_POSIX@ && !defined WEXITSTATUS
 # include <sys/wait.h>
 #endif
 
index fc15019..e4697ce 100644 (file)
@@ -1,4 +1,4 @@
-# stdlib_h.m4 serial 30
+# stdlib_h.m4 serial 31
 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -73,6 +73,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   GNULIB_STRTOD=0;        AC_SUBST([GNULIB_STRTOD])
   GNULIB_STRTOLL=0;       AC_SUBST([GNULIB_STRTOLL])
   GNULIB_STRTOULL=0;      AC_SUBST([GNULIB_STRTOULL])
+  GNULIB_SYSTEM_POSIX=0;  AC_SUBST([GNULIB_SYSTEM_POSIX])
   GNULIB_UNLOCKPT=0;      AC_SUBST([GNULIB_UNLOCKPT])
   GNULIB_UNSETENV=0;      AC_SUBST([GNULIB_UNSETENV])
   dnl Assume proper GNU behavior unless another module says otherwise.
index f822aa3..3392c8d 100644 (file)
@@ -11,7 +11,6 @@ c++defs
 include_next
 stddef
 stdint
-sys_wait
 unistd
 warn-on-use
 
@@ -52,6 +51,7 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \
              -e 's|@''GNULIB_STRTOLL''@|$(GNULIB_STRTOLL)|g' \
              -e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \
+             -e 's|@''GNULIB_SYSTEM_POSIX''@|$(GNULIB_SYSTEM_POSIX)|g' \
              -e 's|@''GNULIB_UNLOCKPT''@|$(GNULIB_UNLOCKPT)|g' \
              -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
              -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
diff --git a/modules/system-posix b/modules/system-posix
new file mode 100644 (file)
index 0000000..d5dc669
--- /dev/null
@@ -0,0 +1,22 @@
+Description:
+system() function: execute a shell command
+
+Files:
+
+Depends-on:
+stdlib
+sys_wait
+
+configure.ac:
+gl_STDLIB_MODULE_INDICATOR([system-posix])
+
+Makefile.am:
+
+Include:
+<stdlib.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
index ec8af17..1e7956b 100644 (file)
@@ -38,7 +38,11 @@ static int exitcode = EXIT_SUCCESS;
    per POSIX 2008.  */
 verify (sizeof NULL == sizeof (void *));
 
-#include "test-sys_wait.h"
+#if GNULIB_TEST_SYSTEM_POSIX
+# include "test-sys_wait.h"
+#else
+# define test_sys_wait_macros() 0
+#endif
 
 int
 main (void)