submitted-waitid
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Mon, 13 Jul 2020 19:34:17 +0000 (20:34 +0100)
committerAurelien Jarno <aurel32@debian.org>
Mon, 13 Jul 2020 19:34:17 +0000 (20:34 +0100)
Gbp-Pq: Topic kfreebsd
Gbp-Pq: Name submitted-waitid.diff

bits/waitflags.h
posix/sys/wait.h
sysdeps/unix/sysv/linux/bits/waitflags.h

index a2f9646b22b61edf6a70fd7b8ad437e559b6c788..2e26282f64fcc4f4f8b5f69b871feda7a7b580e0 100644 (file)
 /* 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_EXTENDED || 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
index a42e16c1b065e9955514c55f909e50ec34a50d35..db6da9c8e5d5de780c4d4942926d675bb74a2fd6 100644 (file)
@@ -69,17 +69,6 @@ typedef __pid_t pid_t;
 # define W_STOPCODE(sig)       __W_STOPCODE (sig)
 #endif
 
-/* The following values are used by the `waitid' function.  */
-#if defined __USE_XOPEN_EXTENDED || 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.
 
index 711d6eccb4e5ac8acf96b2b411024ad4a37012c7..33382cd356285d7f1f3ac71db6a771ce24f336f2 100644 (file)
                                      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_EXTENDED || 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