diff options
author | 2010-04-03 01:49:44 +0000 | |
---|---|---|
committer | 2010-04-03 01:49:44 +0000 | |
commit | 71e32f5d08ae15e870f58c56f15e5f93c5b85957 (patch) | |
tree | 71366328e322cb07e5024cf3d683831fb65fe4d9 | |
parent | sync (diff) | |
download | wireguard-openbsd-71e32f5d08ae15e870f58c56f15e5f93c5b85957.tar.xz wireguard-openbsd-71e32f5d08ae15e870f58c56f15e5f93c5b85957.zip |
Add missing documention:
- fork1() flags: FORK_SIGHAND, FORK_PTRACE, and FORK_THREAD
- RTHREADS kernel option
- rfork() RFTHREAD flag (with a BUGS entry that it's not usable from C)
ok tedu@
-rw-r--r-- | lib/libc/sys/rfork.2 | 20 | ||||
-rw-r--r-- | share/man/man4/options.4 | 10 | ||||
-rw-r--r-- | share/man/man9/fork1.9 | 24 |
3 files changed, 48 insertions, 6 deletions
diff --git a/lib/libc/sys/rfork.2 b/lib/libc/sys/rfork.2 index 5a874b4b33b..0d9a6ccf7a3 100644 --- a/lib/libc/sys/rfork.2 +++ b/lib/libc/sys/rfork.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: rfork.2,v 1.23 2007/05/31 19:19:33 jmc Exp $ +.\" $OpenBSD: rfork.2,v 1.24 2010/04/03 01:49:44 guenther Exp $ .\" .\" Copyright (c) 2003 Jason McIntyre <jmc@openbsd.org> .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: April 3 2010 $ .Dt RFORK 2 .Os .Sh NAME @@ -108,6 +108,14 @@ Zero the child's file descriptor table .Pq i.e. start with a blank file descriptor table . May not be used in conjunction with .Dv RFFDG . +.It Dv RFTHREAD +Create a kernel thread in the current process instead of a separate +process. +Must be combined with +.Dv RFMEM . +Automatically enables +.Dv RFNOWAIT . +The kernel option RTHREADS must be enabled for this to succeed. .El .Pp .Xr fork 2 @@ -157,6 +165,11 @@ as .Dv CHILD_MAX , which is currently defined as 80 in .Aq Pa sys/syslimits.h . +.It Bq Er ENOTSUP +The +.Dv RFTHREAD +flag was set but the kernel was not compiled with the RTHREADS +kernel option. .El .Sh SEE ALSO .Xr _exit 2 , @@ -168,3 +181,6 @@ which is currently defined as 80 in The .Fn rfork function first appeared in Plan 9. +.Sh BUGS +.Dv RFTHREAD +cannot be used from C, as the two threads would return on the same stack. diff --git a/share/man/man4/options.4 b/share/man/man4/options.4 index 25f2573cb24..b6ba58cae45 100644 --- a/share/man/man4/options.4 +++ b/share/man/man4/options.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: options.4,v 1.194 2009/10/22 09:22:46 sobrado Exp $ +.\" $OpenBSD: options.4,v 1.195 2010/04/03 01:49:44 guenther Exp $ .\" $NetBSD: options.4,v 1.21 1997/06/25 03:13:00 thorpej Exp $ .\" .\" Copyright (c) 1998 Theo de Raadt @@ -34,7 +34,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" -.Dd $Mdocdate: October 22 2009 $ +.Dd $Mdocdate: April 3 2010 $ .Dt OPTIONS 4 .Os .Sh NAME @@ -562,6 +562,12 @@ See and .Xr raidctl 8 for details. +.It Cd option RTHREADS +Enable kernel support for kernel-level threads via the +.Dv RFTHREAD +flag to +.Xr rfork 2 . +Currently incomplete. .It Cd option USER_LDT Enable userland manipulation of per-process Local Descriptor Table (LDT) entries; diff --git a/share/man/man9/fork1.9 b/share/man/man9/fork1.9 index 8d927e698e4..c81efc89fa0 100644 --- a/share/man/man9/fork1.9 +++ b/share/man/man9/fork1.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: fork1.9,v 1.12 2009/07/28 12:27:03 jmc Exp $ +.\" $OpenBSD: fork1.9,v 1.13 2010/04/03 01:49:44 guenther Exp $ .\" $NetBSD: fork1.9,v 1.3 1999/03/16 00:40:47 garbled Exp $ .\" .\" Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: July 28 2009 $ +.Dd $Mdocdate: April 3 2010 $ .Dt FORK1 9 .Os .Sh NAME @@ -105,6 +105,26 @@ See The child will share the parent's address space. The default behavior is that the child gets a copy-on-write copy of the address space. +.It Dv FORK_SIGHAND +The child will share the parent's signal actions, including the handler, +mask, and flags, with sigactsshare(). +The default behavior is to copy the signal actions from the parent with +sigactsinit(). +.Dv FORK_SHAREVM +must also be set. +.It Dv FORK_PTRACE +The child will start with tracing enabled, as if +ptrace(PT_TRACE_ME, 0, 0, 0) had been invoked in the child. +.It Dv FORK_THREAD +The child will instead be a kernel-level thread in the same process +as the parent. +.Dv FORK_NOZOMBIE , +.Dv FORK_SHAREVM , +and +.Dv FORK_SIGHAND +must also be set. +If the kernel option RTHREADS isn't enabled then the call will return +.Dv ENOTSUP . .El .Pp If |