From owner-freebsd-current Tue Jul 3 22:50:22 2001 Delivered-To: freebsd-current@freebsd.org Received: from horsey.gshapiro.net (horsey.gshapiro.net [209.220.147.178]) by hub.freebsd.org (Postfix) with ESMTP id 5CF2237B403 for ; Tue, 3 Jul 2001 22:50:20 -0700 (PDT) (envelope-from gshapiro@gshapiro.net) Received: from horsey.gshapiro.net (gshapiro@localhost [127.0.0.1]) by horsey.gshapiro.net (8.12.0.Beta13/8.12.0.Beta13) with ESMTP id f645oJTh010927 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Tue, 3 Jul 2001 22:50:19 -0700 (PDT) Received: (from gshapiro@localhost) by horsey.gshapiro.net (8.12.0.Beta13/8.12.0.Beta13) id f645oJPW010924; Tue, 3 Jul 2001 22:50:19 -0700 (PDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15170.44698.988817.714880@horsey.gshapiro.net> Date: Tue, 3 Jul 2001 22:50:18 -0700 From: Gregory Neil Shapiro To: David Hill Cc: freebsd-current@FreeBSD.ORG Subject: Re: system and (v)fork In-Reply-To: <20010704014703.4ec62b5f.djhill@novagate.net> References: <20010704014703.4ec62b5f.djhill@novagate.net> X-Mailer: VM 6.92 under 21.5 (beta1) "anise" XEmacs Lucid Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG djhill> Reading Advanced Programming in the UNIX Environment by Richard djhill> W. Stevens, I see that he says that vfork() should be used instead djhill> of fork() when you just need to use one of the exec() functions, djhill> since it doesn't need to fully copy the address space. djhill> Later in the book, he has an example system() which uses fork() to djhill> run /bin/sh -c via the execl() function. djhill> Why wouldn't he use vfork() instead of fork()? If there is anything that modifies memory or file descripts between the fork() and exec*() call, you can't use vfork(). To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message