Fri Jul 18 15:56:44 2014 UTC ()
fix typo and minor usage issue


(dholland)
diff -r1.24 -r1.25 src/lib/libc/sys/vfork.2

cvs diff -r1.24 -r1.25 src/lib/libc/sys/vfork.2 (expand / switch to unified diff)

--- src/lib/libc/sys/vfork.2 2003/08/07 16:44:11 1.24
+++ src/lib/libc/sys/vfork.2 2014/07/18 15:56:44 1.25
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: vfork.2,v 1.24 2003/08/07 16:44:11 agc Exp $ 1.\" $NetBSD: vfork.2,v 1.25 2014/07/18 15:56:44 dholland Exp $
2.\" 2.\"
3.\" Copyright (c) 1980, 1991, 1993 3.\" Copyright (c) 1980, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors 14.\" 3. Neither the name of the University nor the names of its contributors
@@ -63,32 +63,32 @@ or an exit (either by a call to @@ -63,32 +63,32 @@ or an exit (either by a call to
63.Xr _exit 2 63.Xr _exit 2
64or abnormally). 64or abnormally).
65The parent process is suspended while the child is using its resources. 65The parent process is suspended while the child is using its resources.
66.Pp 66.Pp
67The 67The
68.Nm 68.Nm
69system call returns 0 in the child's context and (later) the pid 69system call returns 0 in the child's context and (later) the pid
70of the child in the parent's context. 70of the child in the parent's context.
71.Pp 71.Pp
72The 72The
73.Nm 73.Nm
74system call can normally be used just like 74system call can normally be used just like
75.Xr fork 2 . 75.Xr fork 2 .
76It does not work, however, to return while running in the childs context 76It does not work, however, to return while running in the child's context
77from the procedure that called 77from the procedure that called
78.Fn vfork 78.Fn vfork
79since the eventual return from 79since the eventual return from
80.Fn vfork 80.Fn vfork
81would then return to a no longer existent stack frame. 81would then return to a no longer existing stack frame.
82Be careful, also, to call 82Be careful, also, to call
83.Xr _exit 2 83.Xr _exit 2
84rather than 84rather than
85.Xr exit 3 85.Xr exit 3
86if you can't 86if you can't
87.Xr execve 2 , 87.Xr execve 2 ,
88since 88since
89.Xr exit 3 89.Xr exit 3
90will flush and close standard I/O channels, and thereby mess up the 90will flush and close standard I/O channels, and thereby mess up the
91standard I/O data structures 91standard I/O data structures
92in the parent process. 92in the parent process.
93(Even with 93(Even with
94.Xr fork 2 94.Xr fork 2