Sean Doran <firstname.lastname@example.org> writes:
> email@example.com (Paul Wilson) writes:
> > Why not? Can't spawn be implemented in terms of fork, but
> > not vice versa?
Yes, although VMS did a very weird fake of fork using
spawn... unfortunately the semantics were not quite preserved :-(
Spawn certainly should be more portable than fork. I know VMS only
(really) has spawn, and I think one or more of the Microsoft
``Operating Systems'' only has spawn too.
> You will have to cough up a spawn manpage for me;
> I use 4.4 and 4.3-reno derived systems, with the
> occasional painful foray into StunOS, and none of
> these have spawn.
It looks like (this is a fake, cons'ed up from fork and execv:
spawn(2) System Calls spawn(2)
spawn, spawn1 - create a new process
pid_t spawn(const char *path, const char *arg0, ...,
const char *argn, char * /*NULL*/);(char *);
spawn() causes creation of a new process. The new process (child
process) will be executing the program described in path, as if a
fork immediately followed by execv had been executed. Possible
errors are the union of those provided by fork and those provided
by execv. The child process inherits the following attributes
from the parent process: