Re: [PATCH v1 2/4] clone: add CLONE_PIDFD

2019-04-18 Thread Christian Brauner
On Wed, Apr 17, 2019 at 04:22:54PM +0200, Oleg Nesterov wrote: > On 04/16, Christian Brauner wrote: > > > > + if (clone_flags & CLONE_PIDFD) { > > + retval = pidfd_create(pid, &pidfdf); > > + if (retval < 0) > > + goto bad_fork_free_pid; > > + pidfd

Re: [PATCH v1 2/4] clone: add CLONE_PIDFD

2019-04-17 Thread Christian Brauner
On Wed, Apr 17, 2019 at 04:25:51PM +0200, Christian Brauner wrote: > On Wed, Apr 17, 2019 at 04:22:54PM +0200, Oleg Nesterov wrote: > > On 04/16, Christian Brauner wrote: > > > > > > + if (clone_flags & CLONE_PIDFD) { > > > + retval = pidfd_create(pid, &pidfdf); > > > + if (retval <

Re: [PATCH v1 2/4] clone: add CLONE_PIDFD

2019-04-17 Thread Christian Brauner
On Wed, Apr 17, 2019 at 04:22:54PM +0200, Oleg Nesterov wrote: > On 04/16, Christian Brauner wrote: > > > > + if (clone_flags & CLONE_PIDFD) { > > + retval = pidfd_create(pid, &pidfdf); > > + if (retval < 0) > > + goto bad_fork_free_pid; > > + pidfd

Re: [PATCH v1 2/4] clone: add CLONE_PIDFD

2019-04-17 Thread Oleg Nesterov
On 04/16, Christian Brauner wrote: > > + if (clone_flags & CLONE_PIDFD) { > + retval = pidfd_create(pid, &pidfdf); > + if (retval < 0) > + goto bad_fork_free_pid; > + pidfd = retval; > + } ... > + if (clone_flags & CLONE_PIDFD) {

[PATCH v1 2/4] clone: add CLONE_PIDFD

2019-04-16 Thread Christian Brauner
This patchset makes it possible to retrieve pid file descriptors at process creation time by introducing the new flag CLONE_PIDFD to the clone() system call. Linus originally suggested to implement this as a new flag to clone() instead of making it a separate system call. As spotted by Linus, there