aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/sys/pidfd.h
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-01-28 16:59:42 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-05-17 10:33:07 -0300
commit32dd8c251a431c90451092653f0231a4ad2665e5 (patch)
tree5a40d64d21c00b50f5e5a3d253ec79363202fb3c /sysdeps/unix/sysv/linux/sys/pidfd.h
parent97f5d19c45799e3abedef771430b5562f1b8764f (diff)
downloadglibc-32dd8c251a431c90451092653f0231a4ad2665e5.zip
glibc-32dd8c251a431c90451092653f0231a4ad2665e5.tar.gz
glibc-32dd8c251a431c90451092653f0231a4ad2665e5.tar.bz2
linux: Add pidfd_getfd
This was added on Linux 5.6 (8649c322f75c96e7ced2fec201e123b2b073bf09) as a way to retrieve a file descriptors for another process though pidfd (created either with CLONE_PIDFD or pidfd_getfd). The functionality is similar to recvmmsg SCM_RIGHTS. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'sysdeps/unix/sysv/linux/sys/pidfd.h')
-rw-r--r--sysdeps/unix/sysv/linux/sys/pidfd.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/sys/pidfd.h b/sysdeps/unix/sysv/linux/sys/pidfd.h
index dab2710..7194fc2 100644
--- a/sysdeps/unix/sysv/linux/sys/pidfd.h
+++ b/sysdeps/unix/sysv/linux/sys/pidfd.h
@@ -30,4 +30,12 @@
as 0. */
extern int pidfd_open (__pid_t __pid, unsigned int __flags) __THROW;
+/* Duplicates an existing file descriptor TARGETFD in the process referred
+ by the PIDFD file descriptor PIDFD.
+
+ The FLAGS argument is reserved for future use, it must be specified
+ as 0. */
+extern int pidfd_getfd (int __pidfd, int __targetfd,
+ unsigned int __flags) __THROW;
+
#endif /* _PIDFD_H */