Re: [PATCH v1 1/2] pid: add pidfd_open()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Aleksa Sarai <cyphar@xxxxxxxxxx>
- Subject: Re: [PATCH v1 1/2] pid: add pidfd_open()
- From: Oleg Nesterov <oleg@xxxxxxxxxx>
- Date: Thu, 16 May 2019 17:06:12 +0200
- Cc: Christian Brauner <christian@xxxxxxxxxx>, jannh@xxxxxxxxxx, viro@xxxxxxxxxxxxxxxxxx, torvalds@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, arnd@xxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, dhowells@xxxxxxxxxx, ebiederm@xxxxxxxxxxxx, elena.reshetova@xxxxxxxxx, keescook@xxxxxxxxxxxx, luto@xxxxxxxxxxxxxx, luto@xxxxxxxxxx, tglx@xxxxxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-xtensa@xxxxxxxxxxxxxxxx, linux-api@xxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, linux-kselftest@xxxxxxxxxxxxxxx, joel@xxxxxxxxxxxxxxxxx, dancol@xxxxxxxxxx, serge@xxxxxxxxxx, Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
- In-reply-to: <20190516145607.j43xyj26k6l5vmbd@yavin>
- References: <20190516135944.7205-1-christian@brauner.io> <20190516142659.GB22564@redhat.com> <20190516145607.j43xyj26k6l5vmbd@yavin>
- User-agent: Mutt/1.5.24 (2015-08-30)
On 05/17, Aleksa Sarai wrote:
>
> On 2019-05-16, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> > On 05/16, Christian Brauner wrote:
> > >
> > > With the introduction of pidfds through CLONE_PIDFD it is possible to
> > > created pidfds at process creation time.
> >
> > Now I am wondering why do we need CLONE_PIDFD, you can just do
> >
> > pid = fork();
> > pidfd_open(pid);
>
> While the race window would be exceptionally short, there is the
> possibility that the child will die
Yes,
> and their pid will be recycled
> before you do pidfd_open().
No.
Unless the caller's sub-thread does wait() before pidfd_open(), of course.
Or unless you do signal(SIGCHILD, SIG_IGN).
Oleg.
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]