_exit function is the primitive used for process termination
exit. It is declared in the header file unistd.h.
_exitfunction is the primitive for causing a process to terminate with status status. Calling this function does not execute cleanup functions registered with
_Exitfunction is the ISO C equivalent to
_exit. The ISO C committee members were not sure whether the definitions of
_Exitwere compatible so they have not used the POSIX name.
This function was introduced in ISO C99 and is declared in stdlib.h.
When a process terminates for any reason—either because the program terminates, or as a result of a signal—the following things happen:
waitpid; see Process Completion. If the program exited, this status includes as its low-order 8 bits the program exit status.
initprocess, with process ID 1.)
SIGCHLDsignal is sent to the parent process.
SIGHUPsignal is sent to each process in the foreground job, and the controlling terminal is disassociated from that session. See Job Control.
SIGHUPsignal and a
SIGCONTsignal are sent to each process in the group. See Job Control.