This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 3/3] posix: New Linux posix_spawn{p} implementation


On Wed, 31 Aug 2016, Rasmus Villemoes wrote:

> Rather late to the party, but I think there's a few bugs here. Most
> importantly, dup() doesn't preserve the CLOEXEC flag, so if we do move
> the write end around like this, the fd will not automatically be closed
> during the exec, and hence the parent won't receive EOF and will block
> in read() call until the child finally exits. That's easily fixable with
> fcntl(p, F_DUPFD_CLOEXEC, 0). Pretty annoying to add a test for, though.

In Linux-specific code we can assume the presence of dup3 (which needs to 
be called by the name __dup3 in implementations of POSIX functions).

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]