DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

exit(S)


exit, _exit, _Exit -- terminate process

Synopsis

   #include <stdlib.h>
   

void exit(int status);

#include <unistd.h>

void _exit(int status);

#include <unistd.h>

void _Exit(int status);

Description

_exit and _Exit terminate the calling process with the following consequences:

The C function exit calls any functions registered through the atexit function in the reverse order of their registration. The _exit and _Exit functions circumvent all such functions and cleanup. (Note also that if a process receives a signal that has an action of Exit or Core, the functions registered with atexit are not called. See signal(M).)

The symbols EXIT_SUCCESS and EXIT_FAILURE are defined in stdlib.h and may be used as the value of status to indicate successful or unsuccessful termination, respectively. The low-order 8 bits of status is available through wait(S) (and similar functions).

References

_lwp_exit(S), acct(S), atexit(S) intro(S), plock(S), semop(S), sigaction(S), signal(S), times(S), wait(S).

Notices

Considerations for threads programming

The _exit and _Exit system calls terminate the containing process. This implies the termination of all threads.

Considerations for lightweight processes

The termination of the process also implies the termination of all LWPs contained by that process.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005