On Tue, 31 Oct 2006 09:48:26 -0500 James Carlson wrote: > Glenn Fowler writes: > > but I think quality of implementation should push > > posix_spawn() implementers to find a way to make posix_spawn() > > fail immediately on exec error -- with real vfork this is possible > > we've done it in the spwanveg() implementation that uses real vfork/exec
> So, then, let's see to it that posix_spawn is fixed in Solaris. I can point those interested to the code that handles errno when real vfork is available (parent and child share same address space) I also have code in place that handles the posix_spawn spec as it stands the iffe test now distinguishes between posix_spawn() that (2) handles ENOEXEC with immediate ENOEXEC error return (no systems yet) (1) handles ENOEXEC by returning success with 127 exit status returned by immediate waitpid(pid,&status,WNOHANG|WNOWAIT) call (solaris >= 10) (0) otherwise (linux ...) the spawnveg() implementation will use posix_spawn() for cases (2) and (1) case (1) will require an extra waitpid(pid,&status,WNOHANG|WNOWAIT) for each successful posix_spawn() (miniscule in the face of [v]fork+exec) case (1) also means that any utility with exit status 127 *may* be considered ENOEXEC if it exits before the parent waitpid() -- Glenn Fowler -- AT&T Research, Florham Park NJ --