1.\" Copyright (c) 1990, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" This code is derived from software contributed to Berkeley by 5.\" the American National Standards Committee X3, on Information 6.\" Processing Systems. 7.\" 8.\" %sccs.include.redist.man% 9.\" 10.\" @(#)exit.3 8.1 (Berkeley) 06/04/93 11.\" 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 24terminates a process. 25.Pp 26Before termination it performs the following functions in the 27order listed: 28.Bl -enum -offset indent 29.It 30Call the functions registered with the 31.Xr atexit 3 32function, in the reverse order of their registration. 33.It 34Flush all open output streams. 35.It 36Close all open streams. 37.It 38Unlink all files created with the 39.Xr tmpfile 3 40function. 41.El 42.Sh RETURN VALUES 43The 44.Fn exit 45function 46never returns. 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 . 58