xref: /csrg-svn/lib/libc/stdlib/exit.3 (revision 50289)
148349Scael.\" Copyright (c) 1990, 1991 The Regents of the University of California.
242118Sbostic.\" All rights reserved.
320496Smckusick.\"
4*50289Sbostic.\" This code is derived from software contributed to Berkeley by
5*50289Sbostic.\" the American National Standards Committee X3, on Information
6*50289Sbostic.\" Processing Systems.
7*50289Sbostic.\"
842118Sbostic.\" %sccs.include.redist.man%
920496Smckusick.\"
10*50289Sbostic.\"     @(#)exit.3	6.6 (Berkeley) 06/29/91
1142118Sbostic.\"
1248349Scael.Dd
1348349Scael.Dt EXIT 3
1448349Scael.Os
1548349Scael.Sh NAME
1648349Scael.Nm exit
1748349Scael.Nd perform normal program termination
1848349Scael.Sh SYNOPSIS
1948349Scael.Fd #include <stdlib.h>
2048349Scael.Ft void
2148349Scael.Fn exit "int status"
2248349Scael.Sh DESCRIPTION
2348349Scael.Fn Exit
2442118Sbosticterminates a process.
2548349Scael.Pp
2642118SbosticBefore termination it performs the following functions in the
2742118Sbosticorder listed:
2848349Scael.Bl -enum -offset indent
2948349Scael.It
3042118SbosticCall the functions registered with the
3148349Scael.Xr atexit 3
3242118Sbosticfunction, in the reverse order of their registration.
3348349Scael.It
3442118SbosticFlush all open output streams.
3548349Scael.It
3642118SbosticClose all open streams.
3748349Scael.It
3842118SbosticUnlink all files created with the
3948349Scael.Xr tmpfile 3
4042118Sbosticfunction.
4148349Scael.El
4248349Scael.Sh RETURN VALUES
4348349ScaelThe
4448349Scael.Fn exit
4548349Scaelfunction
4620496Smckusicknever returns.
4748349Scael.Sh SEE ALSO
4848349Scael.Xr _exit 2 ,
4948349Scael.Xr atexit 3 ,
5048349Scael.Xr intro 3 ,
5148349Scael.Xr tmpfile 3
5248349Scael.Sh STANDARDS
5348349ScaelThe
5448349Scael.Fn exit
5548349Scaelfunction
5648349Scaelconforms to
5748349Scael.St -ansiC .
58