X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fsys_wait.in.h;h=d7a412640dd67552ab1eaa7a9c1543f103ae1730;hb=78a43be0902f86a52d23649dab497157795278a3;hp=6699c61f07e2ae81200979d26d14008131de953a;hpb=87c5f6fccee477f7e2c67ea4c95e51a3afd83a41;p=gnulib.git diff --git a/lib/sys_wait.in.h b/lib/sys_wait.in.h index 6699c61f0..d7a412640 100644 --- a/lib/sys_wait.in.h +++ b/lib/sys_wait.in.h @@ -21,6 +21,7 @@ #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ #endif +@PRAGMA_COLUMNS@ /* The include_next requires a split double-inclusion guard. */ #if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) @@ -30,6 +31,15 @@ #ifndef _GL_SYS_WAIT_H #define _GL_SYS_WAIT_H +/* Get pid_t. */ +#include + + +/* 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 +71,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 - -# define waitpid(pid,statusp,options) _cwait (statusp, pid, WAIT_CHILD) +# include /* 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 +100,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 */