vfork()

Paul Falstad pfalstad at phoenix.Princeton.EDU
Sat Mar 23 06:50:29 AEST 1991


ralfi at pemcom.pem-stuttgart.de (Ralf U. Holighaus) wrote:
>gwyn at smoke.brl.mil (Doug Gwyn) writes:
>>In article <8372 at rsiatl.Dixie.Com> stan at Dixie.Com (Stan Brown) writes:
>>>   Could someone tell me how this is different from fork()
>>Just replace it with fork().  If that doesn't work, the application
>>is going to need some serious redesign anyway.

Sums it up quite nicely...

>Actually with vfork, the sun process shares text and data with the father
>process, so the only thing possible after a vfork is either an exit by
>the father or an exec by the son. Any other use will cause garbage, be-
>cause neither of the two processes has a data rang for it's own.

Not true.  The parent cannot exit because it's not running; it waits for the
child to exit or exec first.  The child can do whatever it wants to the
parent's data segment before it exit()s or exec()s (except destroy the
parent's stack frame) without causing garbage.  You could even use this call
for a horribly unportable shared memory hack if you wanted.

--
Paul Falstad, pfalstad at phoenix.princeton.edu PLink:HYPNOS GEnie:P.FALSTAD
     To boost the economy, I'd tax all foreigners living abroad.
          Well, at least it's *FRESH* puke!  -Basil Fawlty



More information about the Comp.unix.questions mailing list