exit
Causes the NLM to terminate normally
- Local Servers:blocking
- Remote Servers:N/A
- Classification:ANSI
- Service:Thread
Syntax
#include <nwthread.h>
#include <stdlib.h>
#include <unistd.h>
void exit (
int status);
Parameters
- status
- (IN) Specifies the NLM’s return code. (Currently,
the status is ignored.)
Remarks
The exit function causes a normal termination consisting of
the following sequence of events:
- All threads in the NLM are destroyed.
- This function calls the atexit functions, which
are executed in "last-in, first-out" order.
- Cleanup routines are called for any libraries that
have registered cleanup routines and that the NLM has called. (For
more information, see Library
Concepts (NDK:
Program Management).)
- I/O buffers are flushed, and all second-level
files (opened with fopen, fdopen, freopen) are closed. Any files
created by tmpfile are deleted and purged.
- All screens are closed.
- All remote sessions are terminated.
- All other resources allocated by the NLM are freed.
- The NLM is unloaded.