*BSD News Article 50174


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!news.kei.com!news.mathworks.com!tank.news.pipex.net!pipex!news.sprintlink.net!EU.net!Germany.EU.net!zib-berlin.de!irz401!uriah.heep!bonnie.heep!not-for-mail
From: j@bonnie.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: vfork question
Date: 4 Sep 1995 17:24:52 +0200
Organization: Private U**x site, Dresden.
Lines: 24
Message-ID: <42f5o4$rol@bonnie.tcd-dresden.de>
References: <42amhl$vb@jraynard.demon.co.uk>
Reply-To: joerg_wunsch@uriah.heep.sax.de
NNTP-Posting-Host: 192.109.108.139
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

James Raynard <james@jraynard.demon.co.uk> wrote:

>However, I get
>
>james@jraynard:Chapter8$ ./prog2
>before vfork
>pid=977, glob=6, var=88
>
>implying that the child has not changed the parent's values. Is this
>something which changed between Net/2 (which Stevens describes) and 4.4?

Maybe.  Since the semantics of vfork() do not actually enforce that it
_must_ be possible to modify the parent's address space, this is
rather a ``don't care'' however.  vfork() used to be a workaround for
fork()'s poor performance (and for some VM resource problems) with
limited functionality (the child has been prohibited from modifying
variables shared with the parent), but any sufficient implemention
would be free to have a vfork() that's entirely identical to fork();
this should not break the documented behaviour.
-- 
cheers, J"org                      private:   joerg_wunsch@uriah.heep.sax.de
                                   http://www.sax.de/~joerg/

Never trust an operating system you don't have sources for. ;-)