On Saturday, 9 March 2013 at 16:05:15 UTC, Lars T. Kyllingstad
wrote:
1. Make a "special" spawnProcess() function for pipe
redirection.
2. Use the "process object" approach, like Tango and Qt.
3. After fork(), in the child process, loop over the full range
of possible file descriptors and close the ones we don't want
open.
The last one would let us keep the current API (and would have
the added benefit of cleaning up unused FDs) but I have no idea
how it would impact performance.
How about this: Set FD_CLOEXEC on all pipes just after creation,
but clear the flag for the relevant pipes before exec?