summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorkurt <kurt@openbsd.org>2008-04-04 19:30:41 +0000
committerkurt <kurt@openbsd.org>2008-04-04 19:30:41 +0000
commitcb2f56c4c83cf20c371119e9a0fbf1e9781a0ce3 (patch)
tree72be69d4579d6dc0c65f1bf43aed1881dc25fe03 /lib/libc
parentZero out the password/response argument in the simplified BSD auth (diff)
downloadwireguard-openbsd-cb2f56c4c83cf20c371119e9a0fbf1e9781a0ce3.tar.xz
wireguard-openbsd-cb2f56c4c83cf20c371119e9a0fbf1e9781a0ce3.zip
- do not call pthread_atfork(3) handlers when a multithreaded program
calls vfork(2). "untested, but looks OK" marc@ - document vfork(2), popen(3) and system(3) don't call atfork handlers in multithreaded programs. okay jmc@
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/popen.38
-rw-r--r--lib/libc/stdlib/system.39
-rw-r--r--lib/libc/sys/vfork.28
3 files changed, 19 insertions, 6 deletions
diff --git a/lib/libc/gen/popen.3 b/lib/libc/gen/popen.3
index f3ce3b60ca4..df1a8759a6f 100644
--- a/lib/libc/gen/popen.3
+++ b/lib/libc/gen/popen.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: popen.3,v 1.15 2007/05/31 19:19:28 jmc Exp $
+.\" $OpenBSD: popen.3,v 1.16 2008/04/04 19:30:41 kurt Exp $
.\"
.\" Copyright (c) 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: April 4 2008 $
.Dt POPEN 3
.Os
.Sh NAME
@@ -94,6 +94,10 @@ the command's standard input is the same as that of the process that called
Note that
.Fn popen
output streams are fully buffered by default.
+In addition, fork handlers established using
+.Xr pthread_atfork 3
+are not called when a multithreaded program calls
+.Fn popen .
.Pp
The
.Fn pclose
diff --git a/lib/libc/stdlib/system.3 b/lib/libc/stdlib/system.3
index 338d3bfa835..a49e595bc0a 100644
--- a/lib/libc/stdlib/system.3
+++ b/lib/libc/stdlib/system.3
@@ -29,9 +29,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: system.3,v 1.10 2007/05/31 19:19:32 jmc Exp $
+.\" $OpenBSD: system.3,v 1.11 2008/04/04 19:30:41 kurt Exp $
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: April 4 2008 $
.Dt SYSTEM 3
.Os
.Sh NAME
@@ -66,6 +66,11 @@ Otherwise,
.Fn system
returns the termination status of the shell in the format specified by
.Xr waitpid 2 .
+.Pp
+Note that fork handlers established using
+.Xr pthread_atfork 3
+are not called when a multithreaded program calls
+.Fn system .
.Sh RETURN VALUES
If a child process cannot be created, or the termination status of
the shell cannot be obtained,
diff --git a/lib/libc/sys/vfork.2 b/lib/libc/sys/vfork.2
index c1b4b6ec798..ec0e5a75639 100644
--- a/lib/libc/sys/vfork.2
+++ b/lib/libc/sys/vfork.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: vfork.2,v 1.15 2007/05/31 19:19:34 jmc Exp $
+.\" $OpenBSD: vfork.2,v 1.16 2008/04/04 19:30:41 kurt Exp $
.\" $NetBSD: vfork.2,v 1.8 1997/07/10 07:54:13 mikel Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)vfork.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: April 4 2008 $
.Dt VFORK 2
.Os
.Sh NAME
@@ -62,6 +62,10 @@ in that the parent is suspended until the child makes a call to
or an exit (either by a call to
.Xr _exit 2
or abnormally).
+In addition, fork handlers established using
+.Xr pthread_atfork 3
+are not called when a multithreaded program calls
+.Fn vfork .
.Pp
.Fn vfork
returns 0 in the child's context and (later) the PID of the child in