apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: Pipe inheritance
Date Tue, 17 Jan 2006 23:42:00 GMT
On Tue, Jan 17, 2006 at 03:01:35PM +0100, Peter N. Lundblad wrote:
> While debugging a Subversion problem, I noted that when
> apr_file_pipe_create is called on Linux, the created file descriptors are
> inherited to child processes by default (luckily, one can reset this).
> This is inconsistent with the default for apr_file_open.  If I understand
> it correctly, the Windows code also does *not* make the pipe ends
> inherited by default (it zero-inits the apr_file_t struct and doesn't seem
> to touch the flags, leaving INHERIT unset.
> Nothing of this is documented in apr_file_io.h.
> 
> While I can see the reason for pipes to be inherited by default, it seems
> inconsistent to do so, and you normally only want one end to be inherited,
> so you don't save any code by having that default.
> 
> I could easily provide a patch for this if you want to.  Any thoughts?

Having *both* ends not inherited doesn't seem like a good default since 
the pipe is not very useful for IPC in that case, unless you've dup'ed 
the fds? It wouldn't be reasonable to change that behaviour in APR 1.x 
either, I'd say.

This stuff is woefully undocumented though so patches to clear that up 
would certainly be useful.

Regards,

joe




Mime
View raw message