ON_EXIT(3) Library Functions Manual ON_EXIT(3)
on_exit - name termination handler
int on_exit(procp, arg)
on_exit() names a routine to be called after a program calls exit(3) or
returns normally, and before its process terminates. The routine named
is called as
where status is the argument with which exit() was called, or zero if
main returns. Typically, arg is the address of an argument vector to
(*procp), but may be an integer value. Several calls may be made to
on_exit, specifying several termination handlers. The order in which
they are called is the reverse of that in which they were given to
gprof(1), tcov(1), exit(3)
on_exit() returns zero normally, or nonzero if the procedure name could
not be stored.
This call is specific to the SunOS operating system and should not be
used if portability is a concern.
Standard I/O exit processing is always done last.
7 September 1988 ON_EXIT(3)