submitted-waitid
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Tue, 4 Oct 2022 05:07:58 +0000 (06:07 +0100)
committerAurelien Jarno <aurel32@debian.org>
Tue, 4 Oct 2022 05:07:58 +0000 (06:07 +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 77b53ffb40e2c266380af0f8adab47a887150b5a..3c9f0dd9bec63f67af6d5accc1ef9fae40c33aa8 100644 (file)
 # define WNOWAIT       8               /* Don't reap, just poll status.  */
 # define WEXITED       16              /* Report dead child.  */
 #endif
+
+/* 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 79bcdb013da2177186cade73d7d6e66f64996daa..bcdae4382efa1676b2eaa88285b4064bdb5d7d9d 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 3834d61ff0900a1b4131b8659ab1015b7951e544..3e1b4958da9d937b9566e4562737d2d98f54d123 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