Subject: Re: vfork vs. fork (was Re: popen reentrant (was Re: SA/pthread and vfork))
To: None <tech-kern@NetBSD.org>
From: Matthias Buelow <mkb@mukappabeta.de>
List: tech-kern
Date: 09/15/2003 01:23:53
Ted Unangst writes:

>netbsd does have a clone(), which is really close.  anyway, there is only 
>only one kernel api.  everything uses fork1(), which is used to implement 
>fork(), vfork(), clone() (and on openbsd, rfork(), which is really not 
>much different from clone() that i can tell.)  supporting vfork in the 
>kernel costs nothing.

Well, well.. I knew NetBSD has something back up the sleeve... maybe
I should check better next time. :)  However, the clone manpage tells
me it's just there for easier porting of linux programs and shouldn't
be used for new NetBSD programs... although it doesn't seem to provide
too many options over fork/vfork.  I won't speculate about CLONE_FS
and CLONE_FILES since, although I don't see corresponding flags for
fork1(), I don't know enough about the internal workings to make a
statement about that.  Wouldn't it be nice to export just something
like fork1() to the userland, and additionally have all the other
functions only as library functions?  (Which they don't seem to be,
they're in section 2 after all.)

-- 
  Matthias Buelow;  mkb@{mukappabeta.de,informatik.uni-wuerzburg.de}