[comp.sys.att] vfork is miniframe libraries?

hsu@kampi.hut.fi (Heikki Suonsivu) (06/20/89)

Convergent Miniframe libc has vfork. Does anyone know if it is real or
just a wrapper for fork? No dis.. 

-
 Heikki Suonsivu @ 2:504/1 2:504/7  Kuutamokatu 5 A 7/02210 Espoo/FINLAND
..!mcvax!santra!kampi!hsu hsu@fingate.BITNET hsu@kampi.hut.fi
voice +358-0-1351300 fax -1351948 v22bis -1351526 Out of space. Spaaaceeee.

dehart@darth.PGH.PA.US (Ed DeHart) (06/29/89)

In article <22990@santra.UUCP>, hsu@kampi.hut.fi (Heikki Suonsivu) writes:
> Convergent Miniframe libc has vfork. Does anyone know if it is real or
> just a wrapper for fork? No dis.. 
> 

I had thought that vfork was real since the CT folks used the BSD 4.2 virtual
memory model for CTIX.  Before posting something I decided to test vfork
just to make sure that it really was vfork.

My tests showed that my guess was incorrect and that vfork is just fork with
a different name.

Since the child process uses the parent's address space the first ground rule
is to not mess with anything, just exec out like a good child.  My test program
had the child change the value of something then have the parent print the
result.
--------------------

#define CHILD_PROC 0

main()
{
	int	proc, foo=0;

	if ((proc = vfork()) == CHILD_PROC) {
		foo = 1;
		execl ("/bin/date",0);
		}
	else
		printf ("proc -> %d, foo -> %d\n", proc, foo);
}
I would have expected foo to be 1 if vfork was real but foo was 0.  No vfork.

Thanks, Ed DeHart / wa3yoa
   Usenet:   {pitt | bellcore}!darth!dehart  -OR-  uunet!apexepa!darth!dehart
   Internet: dehart@darth.pgh.pa.us -OR- darth!dehart@vax.cs.pittsburgh.edu