add ANSI contribution notice
[unix-history] / usr / src / lib / libc / stdlib / exit.3
CommitLineData
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 24terminates a process.
ae59e04c 25.Pp
f80403ef
KB
26Before termination it performs the following functions in the
27order listed:
ae59e04c
CL
28.Bl -enum -offset indent
29.It
f80403ef 30Call the functions registered with the
ae59e04c 31.Xr atexit 3
f80403ef 32function, in the reverse order of their registration.
ae59e04c 33.It
f80403ef 34Flush all open output streams.
ae59e04c 35.It
f80403ef 36Close all open streams.
ae59e04c 37.It
f80403ef 38Unlink all files created with the
ae59e04c 39.Xr tmpfile 3
f80403ef 40function.
ae59e04c
CL
41.El
42.Sh RETURN VALUES
43The
44.Fn exit
45function
668ef77e 46never 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
53The
54.Fn exit
55function
56conforms to
57.St -ansiC .