exit(2)


exit, _exit -- terminate process

Synopsis

   #include <stdlib.h> 
   

void exit(int status);

#include <unistd.h>

void _exit(int status);

Description

_exit terminates 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 function _exit circumvents 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(5).)

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(2) (and similar functions).

References

_lwp_exit(2), acct(2), atexit(3C) intro(2), plock(2), semop(2), sigaction(2), signal(2), times(2), wait(2).

Notices

Considerations for threads programming

The _exit system call terminates 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.
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.