atexit, __ateachexit - add program termination routine
int atexit (void (*func)(void));
int __ateachexit (void (*func)(void));
atexit adds the function func to a list of functions to be called without
arguments on normal termination of the program. Normal termination
occurs by either a call to the exit system call or a return from main.
At most 32 functions may be registered by atexit; the functions will be
called in the reverse order of their registration.
For sproc processes, atexit is only called when the last member of the
share group exits, regardless of whether the share group creator has
returned from main.
__ateachexit adds the function func to a list of functions to be called
without arguments on termination of any member of a share group. Note
that the last share group member will call functions registered with
__ateachexit and atexit.
atexit and __ateachexit return 0 if the registration succeeds, nonzero if
PPPPaaaaggggeeee 1111 [ Back ]