> vfork(2) [...] The child code
> between the fork() and subsequent exec() must be carefully written
> because any changes to memory (including stack) or open files will
> also be reflected in the parent.
Not open files: indeed, the main thing you typically want to do before
the exec() is opening
On 2001-Jul-03 22:50:18 -0700, Gregory Neil Shapiro <[EMAIL PROTECTED]> wrote:
>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 expand on Gregory's answer somewhat
On Tue, 3 Jul 2001 22:50:18 -0700
Gregory Neil Shapiro <[EMAIL PROTECTED]> 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()
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
Hello -
Reading Advanced Programming in the UNIX Environment by Richard W. Stevens, I see that
he says that vfork() should be used instead of fork() when you just need to use one of
the exec() functions, since it doesn't need to fully copy the address space.
Later in the book, he has an exampl