Thread (11 messages) 11 messages, 4 authors, 2020-03-31

Re: [PATCH v9 2/4] pid: Implement pidfd_getfd syscall

From: Arnd Bergmann <hidden>
Date: 2020-01-13 14:58:32
Also in: linux-fsdevel, lkml

On Tue, Jan 7, 2020 at 6:59 PM Sargun Dhillon [off-list ref] wrote:
+/**
+ * sys_pidfd_getfd() - Get a file descriptor from another process
+ *
+ * @pidfd:     the pidfd file descriptor of the process
+ * @fd:                the file descriptor number to get
+ * @flags:     flags on how to get the fd (reserved)
+ *
+ * This syscall gets a copy of a file descriptor from another process
+ * based on the pidfd, and file descriptor number. It requires that
+ * the calling process has the ability to ptrace the process represented
+ * by the pidfd. The process which is having its file descriptor copied
+ * is otherwise unaffected.
+ *
+ * Return: On success, a cloexec file descriptor is returned.
+ *         On error, a negative errno number will be returned.
+ */
+SYSCALL_DEFINE3(pidfd_getfd, int, pidfd, int, fd,
+               unsigned int, flags)
This is the most sensible definition I can see. I can not tell
whether we should or want to have it, but if everyone thinks
this is a good idea, then this ABI makes sense.

Reviewed-by: Arnd Bergmann <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help