>The wait() race I referred to before occurs when the child >calls exit(). At that moment, all of the parent's threads >are made runnable and the other thread in wait() may >see the process before the posix_spawn() thread gets >to dispose of it. Of course, this is what obtains when the >posix_spawn() call succeeds, but when posix_spawn() fails >(returns non-zero), the Posix spec says that no child process >shall be created. The implementation actually creates a >child process when posix_spawn() fails with an error from >the child, but if the failing child can be made to disappear >completely then it is "as if" the child had never been created.
There are a number of other cases where we really want to create a process in a library where we: - don't want a SIGCHLD - don't want "wait on any pid" to reap it (Think of system, popen, and others were the library really owns the PID) Casper