Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!swbatl!texbell!ficc!peter From: peter@ficc.ferranti.com (Peter da Silva) Newsgroups: comp.arch Subject: Re: fork, spawn, vfork: an overview Message-ID: <-525C88@xds13.ferranti.com> Date: 8 Aug 90 14:28:47 GMT References: <25904@mimsy.umd.edu> <12382@encore.Encore.COM> <1940@charon.cwi.nl> Reply-To: peter@ficc.ferranti.com (Peter da Silva) Organization: Xenix Support, FICC Lines: 15 In article <1940@charon.cwi.nl> jack@cwi.nl (Jack Jansen) writes: > A reasonably clean solution to the vfork() hack would be to split > fork in two: one call that creates a new kernel environment (u area, > etc), and another one that starts a new process in that environment. You just re-invented vfork! The only difference is that the pid is returned in a different place. > pre_fork(); This is equivalent to "if((pid=vfork()) == 0) {". > pid = spawn("a.out", ....); And this can be replaced by "exec(...); exit(ERROR_CODE); }" -- Peter da Silva. `-_-' +1 713 274 5180. 'U`