From 32dd8c251a431c90451092653f0231a4ad2665e5 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Fri, 28 Jan 2022 16:59:42 -0300 Subject: 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 Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/sys/pidfd.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sysdeps/unix/sysv/linux/sys') 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 */ -- cgit v1.1