vfork() (was Re: RS6000 questions/comments)

Lance Hartmann lance at mpd.tandem.com
Sat Jun 29 05:42:41 AEST 1991


In article <8903 at awdprime.UUCP> ransom at perelandra.austin.ibm.com (Jeff Peek) writes:
>In article <1991Jun27.221208.14845 at kithrup.COM> sef at kithrup.COM (Sean Eric Fagan) writes:
>>In article <141 at ssi.UUCP> cjr at ssi.UUCP (Cris J. Rhea) writes:
>>>* The rs6k like the u370 (that's the 3090) has no vfork().
>>
>>vfork() is a hack, although, I will admit, it does have its uses.  The only
>>legitimate use of vfork() is that the child will execute before the parent.
>>[REMAINDER DELETED]

"...only legitimate use...child will execute before parent"???  The MAIN reason
to use vfork() is when it is desired to spawn a child that does nothing
but an execve().  With this scenario, it is unnecessary to copy the
address space of the parent, so using vfork() is much more efficient.
Also, don't forget to use _exit() (note the leading underscore '_') INSTEAD
of exit() in the event the execve() fails so that you don't hose the parent's
stdio.
-- 
Lance G. Hartmann - cs.utexas.edu!devnull!lance (Internet)
-------------------------------------------------------------------------------
DISCLAIMER:  All opinions/actions expressed herein reflect those of my VERY OWN
and shall NOT bear any reflection upon Tandem or anyone else for that matter.



More information about the Comp.unix.aix mailing list