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