.IR main ().
Functions so registered are called in
the reverse order of their registration; no arguments are passed.
-
+.PP
The same function may be registered multiple times:
it is called once for each registration.
.LP
.BR atexit ()
T} Thread safety MT-Safe
.TE
-
+.sp 1
.SH CONFORMING TO
POSIX.1-2001, POSIX.1-2008, C89, C99, SVr4, 4.3BSD.
.SH NOTES
.BR on_exit (3))
are not called if a process terminates abnormally because
of the delivery of a signal.
-
+.PP
If one of the functions registered functions calls
.BR _exit (2),
then any remaining functions are not invoked,
and the other process termination steps performed by
.BR exit (3)
are not performed.
-
+.PP
POSIX.1 says that the result of calling
.\" POSIX.1-2001, POSIX.1-2008
.BR exit (3)
.BR exit (3)
inside a function registered using
.BR atexit ().
-
+.PP
The
.BR atexit ()
and
at normal process termination,
the registered functions are invoked in reverse order
of their registration by these two functions.
-
+.PP
According to POSIX.1, the result is undefined if
.BR longjmp (3)
is used to terminate execution of one of the functions registered