Re: vfork

Theodore Y. Ts'o (tytso@mit.edu)
Mon, 1 Nov 1999 16:10:16 -0500


Date: Mon, 1 Nov 1999 14:26:26 +0100 (MET)
From: Andries.Brouwer@cwi.nl

People tell me that vfork() no longer is equivalent to fork()
as the manpage states. Unfortunately, they are right, so I
wrote a new page - see below.

I consider the introduction of vfork into Linux a very bad move
(as will be clear from the text I wrote), but since there were
people writing code and submitting patches there must be some
positive side to this horrible kludge.

While in general, I agree with you that vfork is not the nicest thing in
the world, it's not necessarily much worse than some of the other things
you can do with sys_clone(), which also allows two processes to share
virtual memory space.

Despite BSD's man page warning off folks from depending on vfork's
semantics, there were programs --- including BSD's csh, which did use
vfork() so that the path hashing statistics could be accurately updated.
So, there is some excuse for actually implementing vfork() in the
traditional bad old way.

I think you were being a little bit too harsh, myself, but it is true
that warning people that using it compromises the portability of their
programs is perfectly fair.

- Ted

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/