summaryrefslogtreecommitdiff
path: root/lib/libc/sys/fork.2
diff options
context:
space:
mode:
authoryamt <yamt@NetBSD.org>2002-08-11 10:35:48 +0000
committeryamt <yamt@NetBSD.org>2002-08-11 10:35:48 +0000
commita86e2e32730c5b7d2b71bb79afbecfe6567bfa1f (patch)
tree6088fd8fc0ecb33d99515d476b646b7bd714eb2b /lib/libc/sys/fork.2
parentb09419c0607598f2ba84ca228c188fdd4e61469f (diff)
note that child should use _exit instead of exit.
from OpenBSD.
Diffstat (limited to 'lib/libc/sys/fork.2')
-rw-r--r--lib/libc/sys/fork.216
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/libc/sys/fork.2 b/lib/libc/sys/fork.2
index 805b7fa923f..422ba2db2ac 100644
--- a/lib/libc/sys/fork.2
+++ b/lib/libc/sys/fork.2
@@ -1,4 +1,4 @@
-.\" $NetBSD: fork.2,v 1.14 2002/04/29 01:41:45 simonb Exp $
+.\" $NetBSD: fork.2,v 1.15 2002/08/11 10:35:48 yamt Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -33,7 +33,7 @@
.\"
.\" @(#)fork.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd June 4, 1993
+.Dd August 11, 2002
.Dt FORK 2
.Os
.Sh NAME
@@ -75,6 +75,18 @@ The child process' resource utilizations
are set to 0; see
.Xr setrlimit 2 .
.El
+.Pp
+In general, the child process should call
+.Xr _exit 2
+rather than
+.Xr exit 3 .
+Otherwise, any stdio buffers that exist both in the parent and child
+will be flushed twice.
+Similarly,
+.Xr _exit 2
+should be used to prevent
+.Xr atexit 3
+routines from being called twice (once in the parent and once in the child).
.Sh RETURN VALUES
Upon successful completion,
.Fn fork