Creates a list of functions that are executed on a “last-in, first-out” basis when the NLM exits normally.
#include <stdlib.h> int atexit ( void (* func) (void));
(IN) Points to the function to be registered as an atexit function.
If successful, returns 0. Otherwise, returns a nonzero value and sets errno to one of the following:
The atexit functions are called when one of the following occur:
The NLM calls exit.
The last thread in the NLM calls NXThreadExit and it causes the NLM to be terminated.
The last thread in the NLM returns from its original function.
The main thread returns from main.
Successive calls to atexit create a list of functions that are executed on a “last-in, first-out” basis.
The atexit functions are not called when one of the following occurs:
The UnloadModule function is called. This usually occurs because the unload command for the NLM was enter at the System Console, but it can also occur when another NLM calls this function.
One of the threads of the NLM called _exit, abort, or NXVmExit.