atexit(3C)
NAME
atexit − register a function to be executed by exit().
SYNOPSIS
int atexit ( function )
void (∗ function) ();
DESCRIPTION
atexit registers a function for latter execution when the exit routine is called (either explicitly or implicitly when main() exits). Up to 32 such functions can be registered. Exit calls these functions in the reverse order from which they were registered.
SEE ALSO
DIAGNOSTICS
Returns 0 if the function succeded, nonzero otherwise.
CX/UX Programmer’s Reference Manual