#include <stdlib.h>
int atexit(void (*func)(void));
The atexit() function adds the function
func to a list of functions to be called without parameters
on normal termination of the program.
Normal termination occurs by either a call to exit() or
a return from main().
The functions are called in the reverse order of their registration.
- func
-
Identifies the function to be called at program exit.
The atexit() function returns zero if the registration
is successful, non-zero if it fails.
ANSI/ISO 9899-1990, with exceptions.
MT-Safe.
Each DLL has its own list of atexit() handlers.
These handlers are run when the DLL is unloaded, whether dynamically
(via dlclose()) or at process exit.
This ensures that DLLs clean up properly when they are dynamically loaded
and unloaded.
Refer to Windows Concepts and
Porting Shared Libraries in the
PTC MKS Toolkit UNIX to Windows Porting Guide
for more information
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
- Functions:
- exit()
PTC MKS Toolkit 10.5 Documentation Build 40.