Subject: Re: Real vfork() (was: third results)
To: None <tech-kern@NetBSD.ORG>
From: Greg A. Woods <woods@most.weird.com>
List: tech-kern
Date: 04/13/1998 21:13:04
[ On Fri, April 10, 1998 at 11:18:52 (-0400), Gordon W. Ross wrote: ]
> Subject: Re: Real vfork() (was: third results)
>
> There is a POSIX spec. for something like this called: spawn
> and I think it is an extension like 1003.1j or something.
> It was intended for non-VM systems to replace fork+exec.

Unfortunately I don't see anything in the "Single UNIX Specification,
Version 2" about spawn().  I did find a whole lot of neat stuff about, and
ideas for, spawn() et al in the QNX documentation (search hotbot.com for
spawn() and POSIX).

Oh, and to correct one misrepresentation of the standardised vfork(), I
would like to point out that the SUS,v2 specification for vfork() says
nothing at all about the shared memory semantics of vfork().  Instead it
says explicitly:

     The vfork() function has the same effect as fork(), except that the
     behaviour is undefined if the process created by vfork() either  
     modifies any data other than a variable of type pid_t used to store
     the return value from vfork(), or returns from the function in
     which vfork() was called, or calls any other function before 
     successfully calling _exit() or one of the exec family of
     functions.

Under the "APPLICATION USAGE" it says that on some systems vfork() is
the same as fork(), or on others that the child it creates "*can* share
code and data with the calling process" (emphasis added).

This is all from:

	http://www.rdg.opengroup.org/onlinepubs/7908799/xsh/vfork.html

If anyone has a URL for any related POSIX docs, I'd sure appreciate it.

-- 
							Greg A. Woods

+1 416 443-1734      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>