Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jul 2001 01:54:18 -0400
From:      David Hill <djhill@novagate.net>
To:        Gregory Neil Shapiro <gshapiro@FreeBSD.ORG>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: system and (v)fork
Message-ID:  <20010704015418.769fa3eb.djhill@novagate.net>
In-Reply-To: <15170.44698.988817.714880@horsey.gshapiro.net>
References:  <20010704014703.4ec62b5f.djhill@novagate.net> <15170.44698.988817.714880@horsey.gshapiro.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 3 Jul 2001 22:50:18 -0700
Gregory Neil Shapiro <gshapiro@FreeBSD.ORG> wrote:

> 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().
> 

Ahh, understood.

Thanks for the quick response
- David

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010704015418.769fa3eb.djhill>