.\" Modified Wed Jul 21 23:02:38 1993 by Rik Faith <faith@cs.unc.edu>
.\" Modified 2001-11-17, aeb
.\"
-.TH _EXIT 2 2015-07-23 "Linux" "Linux Programmer's Manual"
+.TH _EXIT 2 2017-05-03 "Linux" "Linux Programmer's Manual"
.SH NAME
_exit, _Exit \- terminate the calling process
.SH SYNOPSIS
.B #include <unistd.h>
-.sp
+.PP
.BI "void _exit(int " status );
-.sp
+
.B #include <stdlib.h>
-.sp
+.PP
.BI "void _Exit(int " status );
-.sp
+.PP
.in -4n
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.in
-.sp
+.PP
.ad l
.BR _Exit ():
.RS 4
The function
.BR _exit ()
terminates the calling process "immediately".
-Any open file descriptors
-belonging to the process are closed; any children of the process are
-inherited by process 1,
-.IR init ,
-and the process's parent is sent a
+Any open file descriptors belonging to the process are closed.
+Any children of the process are inherited by
+.BR init (1)
+(or by the nearest "subreaper" process as defined through the use of the
+.BR prctl (2)
+.B PR_SET_CHILD_SUBREAPER
+operation).
+The process's parent is sent a
.B SIGCHLD
signal.
-.LP
+.PP
The value
-.I status
+.I "status & 0377"
is returned to the parent process as the process's exit status, and
can be collected using one of the
.BR wait (2)
family of calls.
-.LP
+.PP
The function
.BR _Exit ()
is equivalent to
For a discussion on the effects of an exit, the transmission of
exit status, zombie processes, signals sent, and so on, see
.BR exit (3).
-.LP
+.PP
The function
.BR _exit ()
is like