diff options
Diffstat (limited to 'src/lib/libc/stdlib/exit.3')
-rw-r--r-- | src/lib/libc/stdlib/exit.3 | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/src/lib/libc/stdlib/exit.3 b/src/lib/libc/stdlib/exit.3 index 8c4b2eed2c..fa233ac75f 100644 --- a/src/lib/libc/stdlib/exit.3 +++ b/src/lib/libc/stdlib/exit.3 | |||
@@ -29,25 +29,30 @@ | |||
29 | .\" 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 |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" $OpenBSD: exit.3,v 1.9 2003/06/02 20:18:37 millert Exp $ | 32 | .\" $OpenBSD: exit.3,v 1.10 2004/05/03 17:21:13 millert Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd June 29, 1991 | 34 | .Dd January 21, 2004 |
35 | .Dt EXIT 3 | 35 | .Dt EXIT 3 |
36 | .Os | 36 | .Os |
37 | .Sh NAME | 37 | .Sh NAME |
38 | .Nm exit | 38 | .Nm exit, _Exit |
39 | .Nd perform normal program termination | 39 | .Nd perform normal program termination |
40 | .Sh SYNOPSIS | 40 | .Sh SYNOPSIS |
41 | .Fd #include <stdlib.h> | 41 | .Fd #include <stdlib.h> |
42 | .Ft void | 42 | .Ft void |
43 | .Fn exit "int status" | 43 | .Fn exit "int status" |
44 | .Ft void | ||
45 | .Fn _Exit "int status" | ||
44 | .Sh DESCRIPTION | 46 | .Sh DESCRIPTION |
45 | The | 47 | The |
46 | .Fn exit | 48 | .Fn exit |
47 | function terminates a process. | 49 | and |
50 | .Fn _Exit | ||
51 | functions terminate a process. | ||
48 | .Pp | 52 | .Pp |
49 | Before termination it performs the following functions in the | 53 | Before termination, |
50 | order listed: | 54 | .Fn exit |
55 | performs the following operations in the order listed: | ||
51 | .Bl -enum -offset indent | 56 | .Bl -enum -offset indent |
52 | .It | 57 | .It |
53 | Call the functions registered with the | 58 | Call the functions registered with the |
@@ -63,9 +68,25 @@ Unlink all files created with the | |||
63 | function. | 68 | function. |
64 | .El | 69 | .El |
65 | .Pp | 70 | .Pp |
66 | Following this, | 71 | The |
72 | .Fn _Exit | ||
73 | function terminates without calling the functions registered with the | ||
74 | .Xr atexit 3 | ||
75 | function. | ||
76 | The | ||
77 | .Ox | ||
78 | implementation of | ||
79 | .Fn _Exit | ||
80 | does not flush open output streams or unlink files created with the | ||
81 | .Xr tmpfile 3 | ||
82 | function. | ||
83 | However, this behavior is implementation-specific. | ||
84 | .Pp | ||
85 | Lastly, | ||
67 | .Fn exit | 86 | .Fn exit |
68 | calls | 87 | and |
88 | .Fn _Exit | ||
89 | call | ||
69 | .Xr _exit 2 . | 90 | .Xr _exit 2 . |
70 | Note that typically | 91 | Note that typically |
71 | .Xr _exit 2 | 92 | .Xr _exit 2 |
@@ -75,7 +96,9 @@ on to the parent, thus negative values have less meaning. | |||
75 | .Sh RETURN VALUES | 96 | .Sh RETURN VALUES |
76 | The | 97 | The |
77 | .Fn exit | 98 | .Fn exit |
78 | function never returns. | 99 | and |
100 | .Fn _Exit | ||
101 | functions never return. | ||
79 | .Sh SEE ALSO | 102 | .Sh SEE ALSO |
80 | .Xr _exit 2 , | 103 | .Xr _exit 2 , |
81 | .Xr atexit 3 , | 104 | .Xr atexit 3 , |
@@ -85,5 +108,7 @@ function never returns. | |||
85 | .Sh STANDARDS | 108 | .Sh STANDARDS |
86 | The | 109 | The |
87 | .Fn exit | 110 | .Fn exit |
88 | function conforms to | 111 | and |
89 | .St -ansiC . | 112 | .Fn _Exit |
113 | functions conform to | ||
114 | .St -ansiC-99 . | ||