diff options
Diffstat (limited to 'src/lib/libc/stdlib/exit.3')
-rw-r--r-- | src/lib/libc/stdlib/exit.3 | 50 |
1 files changed, 34 insertions, 16 deletions
diff --git a/src/lib/libc/stdlib/exit.3 b/src/lib/libc/stdlib/exit.3 index adb81ffcb4..26922ca7b8 100644 --- a/src/lib/libc/stdlib/exit.3 +++ b/src/lib/libc/stdlib/exit.3 | |||
@@ -13,11 +13,7 @@ | |||
13 | .\" 2. Redistributions in binary form must reproduce the above copyright | 13 | .\" 2. Redistributions in binary form must reproduce the above copyright |
14 | .\" notice, this list of conditions and the following disclaimer in the | 14 | .\" notice, this list of conditions and the following disclaimer in the |
15 | .\" documentation and/or other materials provided with the distribution. | 15 | .\" documentation and/or other materials provided with the distribution. |
16 | .\" 3. All advertising materials mentioning features or use of this software | 16 | .\" 3. Neither the name of the University nor the names of its contributors |
17 | .\" must display the following acknowledgement: | ||
18 | .\" This product includes software developed by the University of | ||
19 | .\" California, Berkeley and its contributors. | ||
20 | .\" 4. Neither the name of the University nor the names of its contributors | ||
21 | .\" may be used to endorse or promote products derived from this software | 17 | .\" may be used to endorse or promote products derived from this software |
22 | .\" without specific prior written permission. | 18 | .\" without specific prior written permission. |
23 | .\" | 19 | .\" |
@@ -33,22 +29,22 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
35 | .\" | 31 | .\" |
36 | .\" from: @(#)exit.3 6.6 (Berkeley) 6/29/91 | 32 | .\" $OpenBSD: exit.3,v 1.15 2013/07/17 05:42:11 schwarze Exp $ |
37 | .\" $Id: exit.3,v 1.1.1.1 1995/10/18 08:42:17 deraadt Exp $ | ||
38 | .\" | 33 | .\" |
39 | .Dd June 29, 1991 | 34 | .Dd $Mdocdate: July 17 2013 $ |
40 | .Dt EXIT 3 | 35 | .Dt EXIT 3 |
41 | .Os | 36 | .Os |
42 | .Sh NAME | 37 | .Sh NAME |
43 | .Nm exit | 38 | .Nm exit |
44 | .Nd perform normal program termination | 39 | .Nd perform normal program termination |
45 | .Sh SYNOPSIS | 40 | .Sh SYNOPSIS |
46 | .Fd #include <stdlib.h> | 41 | .In stdlib.h |
47 | .Ft void | 42 | .Ft void |
48 | .Fn exit "int status" | 43 | .Fn exit "int status" |
49 | .Sh DESCRIPTION | 44 | .Sh DESCRIPTION |
50 | .Fn Exit | 45 | The |
51 | terminates a process. | 46 | .Fn exit |
47 | function terminates a process. | ||
52 | .Pp | 48 | .Pp |
53 | Before termination it performs the following functions in the | 49 | Before termination it performs the following functions in the |
54 | order listed: | 50 | order listed: |
@@ -66,19 +62,41 @@ Unlink all files created with the | |||
66 | .Xr tmpfile 3 | 62 | .Xr tmpfile 3 |
67 | function. | 63 | function. |
68 | .El | 64 | .El |
65 | .Pp | ||
66 | Following this, | ||
67 | .Fn exit | ||
68 | calls | ||
69 | .Xr _exit 2 . | ||
70 | Note that typically | ||
71 | .Xr _exit 2 | ||
72 | only passes the lower 8 bits of | ||
73 | .Fa status | ||
74 | on to the parent, thus negative values have less meaning. | ||
69 | .Sh RETURN VALUES | 75 | .Sh RETURN VALUES |
70 | The | 76 | The |
71 | .Fn exit | 77 | .Fn exit |
72 | function | 78 | function never returns. |
73 | never returns. | ||
74 | .Sh SEE ALSO | 79 | .Sh SEE ALSO |
75 | .Xr _exit 2 , | 80 | .Xr _exit 2 , |
76 | .Xr atexit 3 , | 81 | .Xr atexit 3 , |
77 | .Xr intro 3 , | 82 | .Xr intro 3 , |
83 | .Xr sysexits 3 , | ||
78 | .Xr tmpfile 3 | 84 | .Xr tmpfile 3 |
79 | .Sh STANDARDS | 85 | .Sh STANDARDS |
80 | The | 86 | The |
81 | .Fn exit | 87 | .Fn exit |
82 | function | 88 | function conforms to |
83 | conforms to | 89 | .St -ansiC-99 . |
84 | .St -ansiC . | 90 | .Sh HISTORY |
91 | An | ||
92 | .Fn exit | ||
93 | function first appeared as a system call in | ||
94 | .At v1 . | ||
95 | It has accepted the | ||
96 | .Fa status | ||
97 | argument since | ||
98 | .At v2 . | ||
99 | In | ||
100 | .At v7 , | ||
101 | the bare system call was renamed to | ||
102 | .Xr _exit 2 . | ||