summaryrefslogtreecommitdiff
path: root/gl
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2010-09-30 17:28:55 +0200
committerSimon Josefsson <simon@josefsson.org>2010-09-30 17:28:55 +0200
commitef747ffc58f3acf81dba4cb0235822cd089943bc (patch)
tree73324929795cce7286c8a9129e9ba3f4be971a33 /gl
parentc394d8129e75bb86141812cd1129cdbc673937fc (diff)
downloadlibtasn1-ef747ffc58f3acf81dba4cb0235822cd089943bc.tar.gz
libtasn1-ef747ffc58f3acf81dba4cb0235822cd089943bc.tar.bz2
libtasn1-ef747ffc58f3acf81dba4cb0235822cd089943bc.zip
Update gnulib files.
Diffstat (limited to 'gl')
-rw-r--r--gl/Makefile.am5
-rw-r--r--gl/m4/sys_wait_h.m410
-rw-r--r--gl/sys_wait.in.h55
3 files changed, 55 insertions, 15 deletions
diff --git a/gl/Makefile.am b/gl/Makefile.am
index a89d909..574688f 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -541,13 +541,16 @@ BUILT_SOURCES += sys/wait.h
# We need the following in order to create <sys/wait.h> when the system
# has one that is incomplete.
-sys/wait.h: sys_wait.in.h
+sys/wait.h: sys_wait.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
$(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
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; \
} > $@-t && \
mv $@-t $@
diff --git a/gl/m4/sys_wait_h.m4 b/gl/m4/sys_wait_h.m4
index b0d23fa..63e1d21 100644
--- a/gl/m4/sys_wait_h.m4
+++ b/gl/m4/sys_wait_h.m4
@@ -1,4 +1,4 @@
-# sys_wait_h.m4 serial 4
+# sys_wait_h.m4 serial 5
dnl Copyright (C) 2008-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,
@@ -10,6 +10,11 @@ AC_DEFUN([gl_SYS_WAIT_H],
dnl <sys/wait.h> is always overridden, because of GNULIB_POSIXCHECK.
gl_CHECK_NEXT_HEADERS([sys/wait.h])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <sys/wait.h>]],
+ [waitpid])
])
AC_DEFUN([gl_SYS_WAIT_MODULE_INDICATOR],
@@ -17,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/gl/sys_wait.in.h b/gl/sys_wait.in.h
index 009fa21..03a3b26 100644
--- a/gl/sys_wait.in.h
+++ b/gl/sys_wait.in.h
@@ -30,6 +30,15 @@
#ifndef _GL_SYS_WAIT_H
#define _GL_SYS_WAIT_H
+/* Get pid_t. */
+#include <sys/types.h>
+
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
/* Unix API. */
@@ -61,27 +70,20 @@
# define WEXITSTATUS(x) (((x) >> 8) & 0xff)
# endif
+/* The stopping signal. Only to be accessed if WIFSTOPPED(x) is true. */
+# ifndef WSTOPSIG
+# define WSTOPSIG(x) (((x) >> 8) & 0x7f)
+# endif
+
/* True if the process dumped core. Not standardized by POSIX. */
# ifndef WCOREDUMP
# define WCOREDUMP(x) ((x) & 0x80)
# endif
-# ifdef __cplusplus
-extern "C" {
-# endif
-
-/* Declarations of functions. */
-
-# ifdef __cplusplus
-}
-# endif
-
#else
/* Native Windows API. */
-# include <process.h>
-
-# define waitpid(pid,statusp,options) _cwait (statusp, pid, WAIT_CHILD)
+# include <signal.h> /* for SIGTERM */
/* The following macros apply to an argument x, that is a status of a process,
as returned by waitpid() or, equivalently, _cwait() or GetExitCodeProcess().
@@ -97,10 +99,37 @@ extern "C" {
# define WEXITSTATUS(x) (x)
+/* There are no stopping signals. */
+# define WSTOPSIG(x) 0
+
/* There are no core dumps. */
# define WCOREDUMP(x) 0
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Declarations of functions. */
+
+#if @GNULIB_WAITPID@
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+_GL_FUNCDECL_SYS (waitpid, pid_t, (pid_t pid, int *statusp, int options));
+# endif
+_GL_CXXALIAS_SYS (waitpid, pid_t, (pid_t pid, int *statusp, int options));
+_GL_CXXALIASWARN (waitpid);
+#elif defined GNULIB_POSIXCHECK
+# undef waitpid
+# if HAVE_RAW_DECL_WAITPID
+_GL_WARN_ON_USE (waitpid, "waitpid is unportable - "
+ "use gnulib module sys_wait for portability");
+# endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _GL_SYS_WAIT_H */
#endif /* _GL_SYS_WAIT_H */