Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!udel!princeton!phoenix.Princeton.EDU!pfalstad From: pfalstad@phoenix.Princeton.EDU (Paul Falstad) Newsgroups: comp.unix.questions Subject: Re: vfork() Keywords: vfork() Message-ID: <7449@idunno.Princeton.EDU> Date: 22 Mar 91 20:50:29 GMT References: <8372@rsiatl.Dixie.Com> <15533@smoke.brl.mil> <1135@pemcom.pem-stuttgart.de> Sender: news@idunno.Princeton.EDU Organization: League For Fighting Chartered Accountancy Lines: 24 ralfi@pemcom.pem-stuttgart.de (Ralf U. Holighaus) wrote: >gwyn@smoke.brl.mil (Doug Gwyn) writes: >>In article <8372@rsiatl.Dixie.Com> stan@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@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