Commit Graph

39 Commits

Author SHA1 Message Date
Kyle Evans
c34a5f16fa posix_spawn(3): handle potential signal issues with vfork
Described in [1], signal handlers running in a vfork child have
opportunities to corrupt the parent's state. Address this by adding a new
rfork(2) flag, RFSPAWN, that has vfork(2) semantics but also resets signal
handlers in the child during creation.

x86 uses rfork_thread(3) instead of a direct rfork(2) because rfork with
RFMEM/RFSPAWN cannot work when the return address is stored on the stack --
further information about this problem is described under RFMEM in the
rfork(2) man page.

Addressing this has been identified as a prerequisite to using posix_spawn
in subprocess on FreeBSD [2].

[1] https://ewontfix.com/7/
[2] https://bugs.python.org/issue35823

Reviewed by:	jilles, kib
Differential Revision:	https://reviews.freebsd.org/D19058
2019-09-25 19:22:03 +00:00
Kyle Evans
079c5b9ed8 rfork(2): add RFSPAWN flag
When RFSPAWN is passed, rfork exhibits vfork(2) semantics but also resets
signal handlers in the child during creation to avoid a point of corruption
of parent state from the child.

This flag will be used by posix_spawn(3) to handle potential signal issues.

Reviewed by:	jilles, kib
Differential Revision:	https://reviews.freebsd.org/D19058
2019-09-25 19:20:41 +00:00
Konstantin Belousov
134e789b67 Document RFTSIGZMB. Fix spelling of SIGCHLD. Note that signals are
delivered, not returned.

MFC after:	1 week
2011-07-12 20:38:42 +00:00
Jilles Tjoelker
dd888c677b rfork(2): Discourage rfork_thread-like approaches.
Calling rfork_thread(3) does not interoperate with pthreads and global state
is not properly protected.

Remove the BUGS section suggesting LinuxThreads entirely. With the current
pthread library libthr, all threads are kernel-level entities so there seems
little reason to use LinuxThreads.
2011-03-15 23:51:47 +00:00
Pav Lucistnik
79df5e05ee Document RFTHREAD
PR:		docs/78915
Submitted by:	Marc Olzheim <marcolz@stack.nl>
MFC after:	1 week
2007-05-14 13:58:54 +00:00
Ruslan Ermilov
0227791b40 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
Ruslan Ermilov
24a0682c64 Sort sections. 2005-01-20 09:17:07 +00:00
Ruslan Ermilov
1a0a934547 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
Robert Drehmel
d1c2c89dd2 Correct the return value of vfork(2) and rfork(2) in their
manual page function prototypes.
2003-04-27 21:01:34 +00:00
Ruslan Ermilov
522ccf3f35 mdoc(7) police: markup laundry. 2003-02-23 01:47:49 +00:00
Tim J. Robbins
f6f38550e6 Zap another reference to !RFPROC being unsupported that I missed before. 2003-01-31 08:59:00 +00:00
Tim J. Robbins
722ca3efd4 Don't use -compact in list of available flags. Fix tag width. 2003-01-31 08:55:42 +00:00
Tim J. Robbins
34f2304ff2 !RFPROC has been supported for a while now. 2003-01-31 08:45:11 +00:00
Ruslan Ermilov
2efeeba554 mdoc(7) police: "The .Fa argument.". 2002-12-19 09:40:28 +00:00
Ruslan Ermilov
2faeeff4c9 mdoc(7) police: Tidy up the syscall language.
Stop calling system calls "function calls".

Use "The .Fn system call" a-la "The .Nm utility".

When referring to a non-BSD implementation in
the HISTORY section, call syscall a function,
to be safe.
2002-12-18 09:22:32 +00:00
Mike Silbersack
e3682e195b Update docs to reflect change in count of procs reserved for root
from 1 to 10.

PR:		kern/40515
Submitted by:	David Schultz <dschultz@uclink.Berkeley.EDU>
MFC after:	1 day
2002-07-30 05:36:34 +00:00
John Baldwin
6507c9a129 Document that rfork() will return EINVAL if flags not listed in the
manpage are passed in.
2001-12-19 00:59:54 +00:00
Ruslan Ermilov
32eef9aeb1 mdoc(7) police: Use the new .In macro for #include statements. 2001-10-01 16:09:29 +00:00
Ruslan Ermilov
94ba280c59 mdoc(7) police: join split punctuation to macro calls. 2001-08-10 17:35:21 +00:00
Dima Dorfman
7ebcc426ef Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
Matthew Dillon
66e845d8dc Fix type-o
Submitted by: okazaki
2001-03-16 22:18:26 +00:00
Ruslan Ermilov
a2fd3702a3 mdoc(7) police: use canonical form of .Dd macro. 2000-12-11 15:15:20 +00:00
Ruslan Ermilov
a304568fd9 mdoc(7) police: fixed warnings. 2000-11-20 14:22:41 +00:00
Ruslan Ermilov
b5c508fba3 Use Fx macro wherever possible. 2000-11-14 11:20:58 +00:00
Peter Wemm
5cb2354662 Add pointers to rfork_thread(3) 2000-07-31 05:43:43 +00:00
Matthew Dillon
01ba8e704f MFC 1.11.2.3 from -stable to -current 2000-07-25 18:50:22 +00:00
Alexey Zelkin
4f79a4117a Use `Er' variable to define first column width in ERRORS section. It was
initially suggested by mdoc(7) style, but was broken over the years
2000-05-04 13:09:25 +00:00
Alexey Zelkin
25bb73e063 Introduce ".Lb" macro to libc manpages.
More libraries manpages updates following.
2000-04-21 09:42:15 +00:00
Sheldon Hearn
c6ff3a1bf7 Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-02 09:14:21 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Nik Clayton
fbc400a67a Add $Id$, to make it simpler for members of the translation teams to
track.

The $Id$ line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

     .\"    $Id$
     .\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by:            bde
1999-07-12 20:50:10 +00:00
Julian Elischer
88c5ea4574 Enable Linux threads support by default.
This takes the conditionals out of the code that has been tested by
various people for a while.
ps and friends (libkvm) will need a recompile as some proc structure
changes are made.

Submitted by:	"Richard Seaman, Jr." <dick@tar.com>
1999-01-26 02:38:12 +00:00
Bruce Evans
f12d1f0bf6 Fixed style bug in pseudocode. 1997-09-07 04:01:27 +00:00
Wolfram Schneider
75141cc987 Sort cross references. 1997-01-20 23:23:22 +00:00
Mike Pritchard
9880dddc9e Add missing RETURN VALUES/ERRORS sections. 1997-01-12 00:38:36 +00:00
Bruce Evans
b027a2a70d Updated the descriptions of the limits related to EAGAIN.
Changed the error name width for rfork to match fork.
1996-09-29 17:47:46 +00:00
Sujal Patel
ea8c29e94b Fix the man page to reflect the recent addition of RFNOWAIT and the removal of
Plan9 specific flags.
1996-04-18 23:36:41 +00:00
Mike Pritchard
064f007493 Added missing section numbers to a bunch of .Xr macros, or
converted them into .Fn macros where appropriate.  Also fixed
up some minor formatting problems.
1996-03-27 20:49:07 +00:00
Peter Wemm
781006180d rfork/minherit glue in libc
man pages adapted from OpenBSD's versions.
1996-02-23 19:56:55 +00:00