[PATCH v2 3/3] posix: New Linux posix_spawn{p} implementation
Joseph Myers
joseph@codesourcery.com
Wed Aug 31 22:08:00 GMT 2016
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
More information about the Libc-alpha
mailing list