Subject: Re: Why no /usr/include/sys/kthread.h?
To: Jason R Thorpe <>
From: Matthew Orgass <>
List: tech-kern
Date: 06/05/2000 19:18:09
On Sun, 4 Jun 2000, Jason R Thorpe wrote:

> What you should do is add a __clone(2) to the NetBSD C library; we already
> have all the support for it in the kernel, and there's precedent for it
> (Linux).  (Editorial note: calling it rfork(2) would be wrong, since the
> semantics needed would be incompatible with the original rfork(2) from
> Plan 9.)

  I hope this makes it in 1.5.  I think it would be a good idea to also
implement rfork, though. The non-RFPROC case could be used to detatch a
thread's descriptors after a clone or rfork and the RFPROC case (also as
sfork, which is the share everything possible equivalent of fork) is
rather convenient for direct use in some situations where you do not
really need a thread library and would otherwise just use fork.

  It would also be nice to have the MAP_STACK mmap flag as in FreeBSD (but
specify that the created stack always goes the right direction), though
that would probably be more work.

Matthew Orgass