Manual Page Result
0
Command: exit | Section: 3 | Source: UNIX v10 | File: exit.3
EXIT(3) Library Functions Manual EXIT(3)
NAME
exit, atexit, onexit - terminate process
SYNOPSIS
void exit(status)
int status;
int atexit(fn)
int (*fn)();
DESCRIPTION
Exit is the conventional way to terminate a process. Before calling
_exit (see exit(2)) with status as an argument, it calls in reverse or-
der all the functions recorded by atexit.
Exit can never return.
Atexit records fn as a function to be called by exit. It returns zero
if it failed, nonzero otherwise. Typical uses include cleanup routines
for stdio(3) and profiling; see monitor(3).
Calling atexit twice (or more) with the same function argument causes
exit to invoke the function twice (or more).
The function fn should be declared as
int fn()
The function onexit is an obsolescent synonym for atexit. The constant
NONEXIT defined in <libc.h> determines how many functions can be
recorded.
SEE ALSO
exit(2)
EXIT(3)