exit(2)


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(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 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.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004