lkml.org 
[lkml]   [2019]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/4] clone: add CLONE_PIDFD
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 what if we add

if ((clone_flags & (CLONE_PIDFD|CLONE_PARENT_SETTID)) ==
(CLONE_PIDFD|CLONE_PARENT_SETTID))
return ERR_PTR(-EINVAL);

at the start of copy_process() ?

Then it can do

if (clone_flags & CLONE_PIDFD) {
retval = pidfd_create(pid, &pidfdf);
if (retval < 0)
goto bad_fork_free_pid;
retval = put_user(retval, parent_tidptr)
if (retval < 0)
goto bad_fork_free_pid;
}

Oleg.

\
 
 \ /
  Last update: 2019-04-15 12:53    [W:0.063 / U:10.904 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site