* 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-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'.
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:
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
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},
#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
-# 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,
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.
include_next
stddef
stdint
-sys_wait
unistd
warn-on-use
-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' \
--- /dev/null
+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
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)