From: GNU Libc Maintainers Date: Wed, 29 Nov 2017 03:00:21 +0000 (+0000) Subject: submitted-waitid X-Git-Tag: archive/raspbian/2.25-3+rpi1~64 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=eca5978e92011c1ca262991a1de3bede39ed2746;p=glibc.git submitted-waitid Gbp-Pq: Topic kfreebsd Gbp-Pq: Name submitted-waitid.diff --- diff --git a/bits/waitflags.h b/bits/waitflags.h index abc381628..ec31bab89 100644 --- a/bits/waitflags.h +++ b/bits/waitflags.h @@ -24,3 +24,16 @@ /* Bits in the third argument to `waitpid'. */ #define WNOHANG 1 /* Don't block waiting. */ #define WUNTRACED 2 /* Report status of stopped children. */ + +/* The following values are used by the `waitid' function. */ +#if defined __USE_XOPEN || defined __USE_XOPEN2K8 +# ifndef __ENUM_IDTYPE_T +# define __ENUM_IDTYPE_T 1 +typedef enum +{ + P_ALL, /* Wait for any child. */ + P_PID, /* Wait for specified process. */ + P_PGID /* Wait for members of process group. */ +} idtype_t; +# endif +#endif diff --git a/posix/sys/wait.h b/posix/sys/wait.h index 897bfaed6..793df414b 100644 --- a/posix/sys/wait.h +++ b/posix/sys/wait.h @@ -55,17 +55,6 @@ __BEGIN_DECLS # define W_STOPCODE(sig) __W_STOPCODE (sig) #endif -/* The following values are used by the `waitid' function. */ -#if defined __USE_XOPEN || defined __USE_XOPEN2K8 -typedef enum -{ - P_ALL, /* Wait for any child. */ - P_PID, /* Wait for specified process. */ - P_PGID /* Wait for members of process group. */ -} idtype_t; -#endif - - /* Wait for a child to die. When one does, put its status in *STAT_LOC and return its process ID. For errors, return (pid_t) -1. diff --git a/sysdeps/unix/sysv/linux/bits/waitflags.h b/sysdeps/unix/sysv/linux/bits/waitflags.h index 7dcb7b2f3..a714ea138 100644 --- a/sysdeps/unix/sysv/linux/bits/waitflags.h +++ b/sysdeps/unix/sysv/linux/bits/waitflags.h @@ -35,3 +35,23 @@ in this group */ #define __WALL 0x40000000 /* Wait for any child. */ #define __WCLONE 0x80000000 /* Wait for cloned process. */ + +/* The following values are used by the `waitid' function. */ +#if defined __USE_XOPEN || defined __USE_XOPEN2K8 +# ifndef __ENUM_IDTYPE_T +# define __ENUM_IDTYPE_T 1 + +/* The Linux kernel defines these bare, rather than an enum, + which causes a conflict if the include order is reversed. */ +# undef P_ALL +# undef P_PID +# undef P_PGID + +typedef enum +{ + P_ALL, /* Wait for any child. */ + P_PID, /* Wait for specified process. */ + P_PGID /* Wait for members of process group. */ +} idtype_t; +# endif +#endif