ON_EXIT(3)

NAME
on_exit - name termination handler

SYNOPSIS
int on_exit(procp, arg)
void (*procp)();
caddr_t arg;

DESCRIPTION

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
    (*procp)(status, arg);
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 on_exit.

SEE ALSO
gprof(1), tcov(1), exit(3)

DIAGNOSTICS

on_exit() returns zero normally, or nonzero if the procedure name could not be stored.

NOTES

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.