On Apr 10, 2019, at 4:06 PM, Richard Salz <rich.salz(a)gmail.com> wrote:
Quite correct in my experience.
The posix_spawn() API isn’t a panacea but (especially with a few *_np extensions) it’s
much saner for large real-world applications that run a ton of subprocesses. I work on a
large IDE which invokes compilers and such, and it makes a huge difference.
The biggest need for *_np extensions has been control over fd inheritance and chdir
behavior. Otherwise a subprocess can wind up inheriting random or no fds from a
multithreaded process (thanks to the race between setting up and finishing the call) and
you need to use pthread_{chdir,fchdir}() or openat() to set the working directory in which
the subprocess is launched.
-- Chris