Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/sys note that child should use _exit instead of exit.



details:   https://anonhg.NetBSD.org/src/rev/9b267c3df7f5
branches:  trunk
changeset: 535152:9b267c3df7f5
user:      yamt <yamt%NetBSD.org@localhost>
date:      Sun Aug 11 10:35:48 2002 +0000

description:
note that child should use _exit instead of exit.
from OpenBSD.

diffstat:

 lib/libc/sys/fork.2 |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r 1562cd237318 -r 9b267c3df7f5 lib/libc/sys/fork.2
--- a/lib/libc/sys/fork.2       Sun Aug 11 10:28:23 2002 +0000
+++ b/lib/libc/sys/fork.2       Sun Aug 11 10:35:48 2002 +0000
@@ -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 @@
 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



Home | Main Index | Thread Index | Old Index