NAME | SYNOPSIS | DESCRIPTION | NOTES | ATTRIBUTES | SEE ALSO
#include <stdlib.h>void exit(int status);
The exit function terminates the calling actor with the following consequences:
Any functions registered using the atexit(3STDC) function are called in the reverse order of their registration.
Cleanup actions are performed.
The actor is terminated by calling _exit(2K).
To circumvent these actions, call _exit(2K) directly.
The processing of atexit(3STDC) functions is protected against concurrent execution. As a result, if several threads are performing exit at the same time, all but one will be blocked before the atexit(3STDC) processing is performed. The fact that one particular thread is performing exit does not prevent other threads from running. It is up to the application programmer to manage any conflicts resulting from this.
The exit function never returns. However, if the thread performing an atexit(3STDC) processing longjmps back into the application, further calls to exit will block the caller for ever; in such a case, the only valid way to terminate the application is to call _exit(2K).
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | DESCRIPTION | NOTES | ATTRIBUTES | SEE ALSO