public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Subject: [PATCH v2 04/15] linux: Add P_PIDFD
Date: Mon,  7 Feb 2022 14:44:20 -0300	[thread overview]
Message-ID: <20220207174431.360355-5-adhemerval.zanella@linaro.org> (raw)
In-Reply-To: <20220207174431.360355-1-adhemerval.zanella@linaro.org>

It was added on Linux 5.4 (3695eae5fee0605f316fbaad0b9e3de791d7dfaf)
to extend waitid to wait on pidfd.
---
 posix/Makefile                                |  2 +-
 posix/sys/wait.h                              |  7 +------
 sysdeps/mach/hurd/bits/types/idtype_t.h       | 12 ++++++++++++
 sysdeps/unix/sysv/linux/bits/types/idtype_t.h | 14 ++++++++++++++
 4 files changed, 28 insertions(+), 7 deletions(-)
 create mode 100644 sysdeps/mach/hurd/bits/types/idtype_t.h
 create mode 100644 sysdeps/unix/sysv/linux/bits/types/idtype_t.h

diff --git a/posix/Makefile b/posix/Makefile
index 9b30b53a7c..cfebb8ef06 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -32,7 +32,7 @@ headers	:= sys/utsname.h sys/times.h sys/wait.h sys/types.h unistd.h	      \
 	   bits/waitflags.h bits/waitstatus.h sys/unistd.h sched.h	      \
 	   bits/sched.h bits/cpu-set.h re_comp.h wait.h bits/environments.h   \
 	   cpio.h spawn.h bits/unistd.h bits/types/struct_sched_param.h	      \
-	   bits/unistd_ext.h
+	   bits/unistd_ext.h bits/types/idtype_t.h
 
 routines :=								      \
 	uname								      \
diff --git a/posix/sys/wait.h b/posix/sys/wait.h
index 79bcdb013d..4d649cd4b1 100644
--- a/posix/sys/wait.h
+++ b/posix/sys/wait.h
@@ -71,12 +71,7 @@ typedef __pid_t pid_t;
 
 /* 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;
+# include <bits/types/idtype_t.h>
 #endif
 
 
diff --git a/sysdeps/mach/hurd/bits/types/idtype_t.h b/sysdeps/mach/hurd/bits/types/idtype_t.h
new file mode 100644
index 0000000000..207eb777ba
--- /dev/null
+++ b/sysdeps/mach/hurd/bits/types/idtype_t.h
@@ -0,0 +1,12 @@
+#ifndef __idtype_t_defined
+#define __idtype_t_defined
+
+/* The following values are used by the `waitid' function.  */
+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
diff --git a/sysdeps/unix/sysv/linux/bits/types/idtype_t.h b/sysdeps/unix/sysv/linux/bits/types/idtype_t.h
new file mode 100644
index 0000000000..fc084c7774
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/types/idtype_t.h
@@ -0,0 +1,14 @@
+#ifndef __idtype_t_defined
+#define __idtype_t_defined
+
+/* The following values are used by the `waitid' function.  */
+typedef enum
+{
+  P_ALL,		/* Wait for any child.  */
+  P_PID,		/* Wait for specified process.  */
+  P_PGID,		/* Wait for members of process group.  */
+  P_PIDFD,		/* Wait for the child referred by the PID file
+			   descriptor.  */
+} idtype_t;
+
+#endif
-- 
2.32.0


  parent reply	other threads:[~2022-02-07 17:44 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-07 17:44 [PATCH v2 00/15] linux: Add new syscalls Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 01/15] linux: Add pidfd_open Adhemerval Zanella
2022-05-16 21:12   ` Carlos O'Donell
2022-06-01 18:02   ` Matheus Castanho
2022-06-01 18:49     ` Adhemerval Zanella
2022-06-01 20:53       ` Matheus Castanho
2022-06-01 22:22         ` Joseph Myers
2022-02-07 17:44 ` [PATCH v2 02/15] linux: Add pidfd_getfd Adhemerval Zanella
2022-05-16 21:12   ` Carlos O'Donell
2022-02-07 17:44 ` [PATCH v2 03/15] linux: Add pidfd_send_signal Adhemerval Zanella
2022-05-16 21:12   ` Carlos O'Donell
2022-02-07 17:44 ` Adhemerval Zanella [this message]
2022-05-16 21:12   ` [PATCH v2 04/15] linux: Add P_PIDFD Carlos O'Donell
2022-02-07 17:44 ` [PATCH v2 05/15] linux: Add tst-pidfd.c Adhemerval Zanella
2022-05-16 21:12   ` Carlos O'Donell
2022-02-07 17:44 ` [PATCH v2 06/15] linux: Add process_madvise Adhemerval Zanella
2022-05-31 22:03   ` Carlos O'Donell
2022-06-01 18:04     ` Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 07/15] linux: Add process_mrelease Adhemerval Zanella
2022-05-31 22:12   ` Carlos O'Donell
2022-06-01 18:35     ` Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 08/15] linux: Add fsopen Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 09/15] linux: Add fsmount Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 10/15] linux: Add move_mount Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 11/15] linux: Add fsconfig Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 12/15] linux: Add fspick Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 13/15] linux: Add open_tree Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 14/15] linux: Add tst-mount to check for Linux new mount API Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 15/15] linux: Add mount_setattr Adhemerval Zanella
2022-05-16 21:12 ` [PATCH v2 00/15] linux: Add new syscalls Carlos O'Donell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220207174431.360355-5-adhemerval.zanella@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).