Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-06-15 Thread Florian Weimer
On 05/29/2015 10:27 PM, Thiago Macieira wrote: >> It has been suggested (e.g., >> ) that you can >> use the existing clone(2) without specifying SIGCHLD to create a new >> process. The resulting child process is not supposed to show up in

Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-05-29 Thread Thiago Macieira
On Friday 29 May 2015 09:43:35 Florian Weimer wrote: > On 03/15/2015 08:59 AM, Josh Triplett wrote: > > This patch series introduces a new clone flag, CLONE_FD, which lets the > > caller receive child process exit notification via a file descriptor > > rather than SIGCHLD. CLONE_FD makes it possib

Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-05-29 Thread Florian Weimer
On 03/15/2015 08:59 AM, Josh Triplett wrote: > This patch series introduces a new clone flag, CLONE_FD, which lets the caller > receive child process exit notification via a file descriptor rather than > SIGCHLD. CLONE_FD makes it possible for libraries to safely launch and manage > child processe

Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-04-08 Thread Josh Triplett
On Wed, Apr 01, 2015 at 09:24:20AM +0200, Jonathan Corbet wrote: > On Tue, 31 Mar 2015 15:02:24 -0700 > j...@joshtriplett.org wrote: > > > > This would appear to assume that a clonefd_info structure is the only > > > thing that will ever be read from this descriptor. It seems to me that > > > the

Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-04-01 Thread Jonathan Corbet
On Tue, 31 Mar 2015 15:02:24 -0700 j...@joshtriplett.org wrote: > > This would appear to assume that a clonefd_info structure is the only > > thing that will ever be read from this descriptor. It seems to me that > > there is the potential for, someday, wanting to be able to read and write > > ot

Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-03-31 Thread josh
On Tue, Mar 31, 2015 at 10:08:07PM +0200, Jonathan Corbet wrote: > So I finally got around to having a look at this, and one thing caught my > eye: > > > read(2) (and similar) > > When the new process exits, reading from the > > file > >

Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-03-31 Thread Jonathan Corbet
So I finally got around to having a look at this, and one thing caught my eye: > read(2) (and similar) > When the new process exits, reading from the file > descriptor produces a single clonefd_info structure: > >

Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-03-23 Thread josh
On Mon, Mar 23, 2015 at 02:12:34PM +, David Drysdale wrote: > On Mon, Mar 16, 2015 at 11:29 PM, wrote: > > On Mon, Mar 16, 2015 at 03:14:14PM -0700, Thiago Macieira wrote: > >> On Monday 16 March 2015 14:44:20 Kees Cook wrote: > >> > > O_CLOEXEC > >> > > Set

Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-03-23 Thread David Drysdale
On Mon, Mar 16, 2015 at 11:29 PM, wrote: > On Mon, Mar 16, 2015 at 03:14:14PM -0700, Thiago Macieira wrote: >> On Monday 16 March 2015 14:44:20 Kees Cook wrote: >> > > O_CLOEXEC >> > > Set the close-on-exec flag on the new file >> > >descriptor. See the descr

Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-03-16 Thread Thiago Macieira
On Monday 16 March 2015 16:29:49 j...@joshtriplett.org wrote: > > A child without CLONE_AUTOREAP should be wait()able. If it gets wait()ed > > before the clonefd is read, the clonefd() will return a 0 read. If it > > gets > > read before wait, then wait() reaps another child or returns -ECHILD. >

Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-03-16 Thread josh
On Mon, Mar 16, 2015 at 03:36:16PM -0700, Kees Cook wrote: > On Mon, Mar 16, 2015 at 3:14 PM, Thiago Macieira > wrote: > > On Monday 16 March 2015 14:44:20 Kees Cook wrote: > >> > O_CLOEXEC > >> > Set the close-on-exec flag on the new file > >> >descriptor. Se

Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-03-16 Thread josh
On Mon, Mar 16, 2015 at 03:14:14PM -0700, Thiago Macieira wrote: > On Monday 16 March 2015 14:44:20 Kees Cook wrote: > > > O_CLOEXEC > > > Set the close-on-exec flag on the new file > > >descriptor. See the description of the O_CLOEXEC flag in open(2) for > >

Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-03-16 Thread Kees Cook
On Mon, Mar 16, 2015 at 3:50 PM, Thiago Macieira wrote: > On Monday 16 March 2015 15:36:16 Kees Cook wrote: >> And just so I understand the races here, what happens in CLONE_FD >> (without CLONE_AUTOREAP) case where the child dies, but the parent >> never reads from the CLONE_FD fd, and closes it

Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-03-16 Thread josh
On Mon, Mar 16, 2015 at 02:44:20PM -0700, Kees Cook wrote: > On Sun, Mar 15, 2015 at 12:59 AM, Josh Triplett wrote: > > - Make poll on a CLONE_FD for an exited task also return POLLHUP, for > > compatibility with FreeBSD's pdfork. Thanks to David Drysdale for calling > > attention to pdfork.

Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-03-16 Thread Thiago Macieira
On Monday 16 March 2015 15:36:16 Kees Cook wrote: > And just so I understand the races here, what happens in CLONE_FD > (without CLONE_AUTOREAP) case where the child dies, but the parent > never reads from the CLONE_FD fd, and closes it (or dies)? Will the > modes switch that late in the child's li

Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-03-16 Thread Kees Cook
On Mon, Mar 16, 2015 at 3:14 PM, Thiago Macieira wrote: > On Monday 16 March 2015 14:44:20 Kees Cook wrote: >> > O_CLOEXEC >> > Set the close-on-exec flag on the new file >> >descriptor. See the description of the O_CLOEXEC flag in open(2) for >> >reasons why

Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-03-16 Thread Thiago Macieira
On Monday 16 March 2015 14:44:20 Kees Cook wrote: > > O_CLOEXEC > > Set the close-on-exec flag on the new file > >descriptor. See the description of the O_CLOEXEC flag in open(2) for > >reasons why this may be useful. > > This begs the question: what happens

Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-03-16 Thread Kees Cook
On Sun, Mar 15, 2015 at 12:59 AM, Josh Triplett wrote: > This patch series introduces a new clone flag, CLONE_FD, which lets the caller > receive child process exit notification via a file descriptor rather than > SIGCHLD. CLONE_FD makes it possible for libraries to safely launch and manage > chi

Re: [PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-03-15 Thread Josh Triplett
On Sun, Mar 15, 2015 at 12:59:17AM -0700, Josh Triplett wrote: > This patch series also introduces a clone flag CLONE_AUTOREAP, which causes > the > kernel to automatically reap the child process when it exits, just as it does > for processes using SIGCHLD when the parent has SIGCHLD ignored or ma

[PATCH v2 0/7] CLONE_FD: Task exit notification via file descriptor

2015-03-15 Thread Josh Triplett
This patch series introduces a new clone flag, CLONE_FD, which lets the caller receive child process exit notification via a file descriptor rather than SIGCHLD. CLONE_FD makes it possible for libraries to safely launch and manage child processes on behalf of their caller, *without* taking over pr