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

2019-04-15 Thread Daniel Colascione
On Mon, Apr 15, 2019 at 10:15 AM Jonathan Kowalski wrote: > > Why else do we want pidfd? > > Apart from what others have already pointed out, there are two other > things I am looking forward to: Everything that Christian, Joel, and Jonathan have said is right. If I can wax philosophical for a b

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

2019-04-15 Thread Jonathan Kowalski
On Mon, Apr 15, 2019 at 2:25 PM Oleg Nesterov wrote: > > On 04/15, Christian Brauner wrote: > > > > > CLONE_PARENT_SETTID doesn't look very usefule, so what if we add > > > > > > if ((clone_flags & (CLONE_PIDFD|CLONE_PARENT_SETTID)) == > > >(CLONE_PIDFD|CLONE_PARENT_SET

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

2019-04-15 Thread Joel Fernandes
On Mon, Apr 15, 2019 at 03:52:48PM +0200, Christian Brauner wrote: > On Mon, Apr 15, 2019 at 03:24:16PM +0200, Oleg Nesterov wrote: > > On 04/15, Christian Brauner wrote: > > > > > > > CLONE_PARENT_SETTID doesn't look very usefule, so what if we add > > > > > > > > if ((clone_flags & (CLONE

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

2019-04-15 Thread Christian Brauner
On Mon, Apr 15, 2019 at 03:24:16PM +0200, Oleg Nesterov wrote: > On 04/15, Christian Brauner wrote: > > > > > CLONE_PARENT_SETTID doesn't look very usefule, so what if we add > > > > > > if ((clone_flags & (CLONE_PIDFD|CLONE_PARENT_SETTID)) == > > > (CLONE_PIDFD|CLONE_PARENT_

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

2019-04-15 Thread Oleg Nesterov
On 04/15, Christian Brauner wrote: > > > CLONE_PARENT_SETTID doesn't look very usefule, so what if we add > > > > if ((clone_flags & (CLONE_PIDFD|CLONE_PARENT_SETTID)) == > >(CLONE_PIDFD|CLONE_PARENT_SETTID)) > > return ERR_PTR(-EINVAL); > > > > at the start

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

2019-04-15 Thread Christian Brauner
On Mon, Apr 15, 2019 at 12:52:09PM +0200, Oleg Nesterov wrote: > On 04/14, Christian Brauner wrote: > > > > @@ -2260,6 +2363,10 @@ long _do_fork(unsigned long clone_flags, > > } > > > > put_pid(pid); > > + > > + if (clone_flags & CLONE_PIDFD) > > + nr = pidfd; > > + > > Well, t

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

2019-04-15 Thread Oleg Nesterov
On 04/14, Christian Brauner wrote: > > @@ -2260,6 +2363,10 @@ long _do_fork(unsigned long clone_flags, > } > > put_pid(pid); > + > + if (clone_flags & CLONE_PIDFD) > + nr = pidfd; > + Well, this doesn't look nice ... CLONE_PARENT_SETTID doesn't look very usefule, so wh

[PATCH 2/4] clone: add CLONE_PIDFD

2019-04-14 Thread Christian Brauner
As discussed 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