xref: /csrg-svn/lib/libc/stdlib/exit.3 (revision 48349)
1*48349Scael.\" Copyright (c) 1990, 1991 The Regents of the University of California.
242118Sbostic.\" All rights reserved.
320496Smckusick.\"
442118Sbostic.\" %sccs.include.redist.man%
520496Smckusick.\"
6*48349Scael.\"     @(#)exit.3	6.5 (Berkeley) 04/19/91
742118Sbostic.\"
8*48349Scael.Dd
9*48349Scael.Dt EXIT 3
10*48349Scael.Os
11*48349Scael.Sh NAME
12*48349Scael.Nm exit
13*48349Scael.Nd perform normal program termination
14*48349Scael.Sh SYNOPSIS
15*48349Scael.Fd #include <stdlib.h>
16*48349Scael.Ft void
17*48349Scael.Fn exit "int status"
18*48349Scael.Sh DESCRIPTION
19*48349Scael.Fn Exit
2042118Sbosticterminates a process.
21*48349Scael.Pp
2242118SbosticBefore termination it performs the following functions in the
2342118Sbosticorder listed:
24*48349Scael.Bl -enum -offset indent
25*48349Scael.It
2642118SbosticCall the functions registered with the
27*48349Scael.Xr atexit 3
2842118Sbosticfunction, in the reverse order of their registration.
29*48349Scael.It
3042118SbosticFlush all open output streams.
31*48349Scael.It
3242118SbosticClose all open streams.
33*48349Scael.It
3442118SbosticUnlink all files created with the
35*48349Scael.Xr tmpfile 3
3642118Sbosticfunction.
37*48349Scael.El
38*48349Scael.Sh RETURN VALUES
39*48349ScaelThe
40*48349Scael.Fn exit
41*48349Scaelfunction
4220496Smckusicknever returns.
43*48349Scael.Sh SEE ALSO
44*48349Scael.Xr _exit 2 ,
45*48349Scael.Xr atexit 3 ,
46*48349Scael.Xr intro 3 ,
47*48349Scael.Xr tmpfile 3
48*48349Scael.Sh STANDARDS
49*48349ScaelThe
50*48349Scael.Fn exit
51*48349Scaelfunction
52*48349Scaelconforms to
53*48349Scael.St -ansiC .
54