Commit | Line | Data |
---|---|---|
ae59e04c | 1 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. |
f80403ef | 2 | .\" All rights reserved. |
668ef77e | 3 | .\" |
043368e6 KB |
4 | .\" This code is derived from software contributed to Berkeley by |
5 | .\" the American National Standards Committee X3, on Information | |
6 | .\" Processing Systems. | |
7 | .\" | |
f80403ef KB |
8 | .\" %sccs.include.redist.man% |
9 | .\" | |
043368e6 | 10 | .\" @(#)exit.3 6.6 (Berkeley) %G% |
668ef77e | 11 | .\" |
ae59e04c CL |
12 | .Dd |
13 | .Dt EXIT 3 | |
14 | .Os | |
15 | .Sh NAME | |
16 | .Nm exit | |
17 | .Nd perform normal program termination | |
18 | .Sh SYNOPSIS | |
19 | .Fd #include <stdlib.h> | |
20 | .Ft void | |
21 | .Fn exit "int status" | |
22 | .Sh DESCRIPTION | |
23 | .Fn Exit | |
f80403ef | 24 | terminates a process. |
ae59e04c | 25 | .Pp |
f80403ef KB |
26 | Before termination it performs the following functions in the |
27 | order listed: | |
ae59e04c CL |
28 | .Bl -enum -offset indent |
29 | .It | |
f80403ef | 30 | Call the functions registered with the |
ae59e04c | 31 | .Xr atexit 3 |
f80403ef | 32 | function, in the reverse order of their registration. |
ae59e04c | 33 | .It |
f80403ef | 34 | Flush all open output streams. |
ae59e04c | 35 | .It |
f80403ef | 36 | Close all open streams. |
ae59e04c | 37 | .It |
f80403ef | 38 | Unlink all files created with the |
ae59e04c | 39 | .Xr tmpfile 3 |
f80403ef | 40 | function. |
ae59e04c CL |
41 | .El |
42 | .Sh RETURN VALUES | |
43 | The | |
44 | .Fn exit | |
45 | function | |
668ef77e | 46 | never returns. |
ae59e04c CL |
47 | .Sh SEE ALSO |
48 | .Xr _exit 2 , | |
49 | .Xr atexit 3 , | |
50 | .Xr intro 3 , | |
51 | .Xr tmpfile 3 | |
52 | .Sh STANDARDS | |
53 | The | |
54 | .Fn exit | |
55 | function | |
56 | conforms to | |
57 | .St -ansiC . |