[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    atexit(3C) manual page Table of Contents

Name

atexit - add program termination routine

Synopsis

#include <stdlib.h>

int atexit(void (*func)(void));

MT-Level

Safe

Description

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() function 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.

Return Values

atexit() returns 0 if the registration succeeds, nonzero if it fails.

See Also

exit(3C)


Table of Contents