Section: Linux Programmer's Manual (2)
Return to Main Contents
_exit, _Exit - terminate the calling process
void _exit(int status);
void _Exit(int status);
Feature Test Macro Requirements for glibc (see
_ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
terminates the calling process "immediately".
Any open file descriptors belonging to the process are closed.
Any children of the process are inherited by
(or by the nearest "subreaper" process as defined through the use of the
The process's parent is sent a
status & 0377
is returned to the parent process as the process's exit status, and
can be collected using one of the
family of calls.
is equivalent to
These functions do not return.
POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD.
was introduced by C99.
For a discussion on the effects of an exit, the transmission of
exit status, zombie processes, signals sent, and so on, see
but does not call any
functions registered with
streams are not flushed.
On the other hand,
does close open file descriptors, and this may cause an unknown delay,
waiting for pending output to finish.
If the delay is undesired,
it may be useful to call functions like
Whether any pending I/O is canceled, and which pending I/O may be
C library/kernel differences
In glibc up to version 2.3, the
wrapper function invoked the kernel system call of the same name.
Since glibc 2.3, the wrapper function invokes
in order to terminate all of the threads in a process.
This page is part of release 4.15 of the Linux
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
- RETURN VALUE
- CONFORMING TO
- C library/kernel differences
- SEE ALSO
This document was created by
using the manual pages.
Time: 20:27:02 GMT, September 22, 2018