_exit, _Exit − terminate the calling process


#include <unistd.h>

void _exit(int status);

#include <stdlib.h>

void _Exit(int status);

Feature Test Macro Requirements for glibc (see feature_test_macros(7)):


_XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L;
or cc -std=c99


The function _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, init, and the process’s parent is sent a SIGCHLD signal.

The value status is returned to the parent process as the process’s exit status, and can be collected using one of the wait(2) family of calls.

The function _Exit() is equivalent to _exit().


These functions do not return.


SVr4, POSIX.1-2001, 4.3BSD. The function _Exit() 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 exit(3).

The function _exit() is like exit(3), but does not call any functions registered with atexit(3) or on_exit(3). Whether it flushes standard I/O buffers and removes temporary files created with tmpfile(3) is implementation-dependent. On the other hand, _exit() 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 tcflush(3) before calling _exit(). Whether any pending I/O is canceled, and which pending I/O may be canceled upon _exit(), is implementation-dependent.

In glibc up to version 2.3, the _exit() wrapper function invoked the kernel system call of the same name. Since glibc 2.3, the wrapper function invokes exit_group(2), in order to terminate all of the threads in a process.


execve(2), exit_group(2), fork(2), kill(2), wait(2), wait4(2), waitpid(2), atexit(3), exit(3), on_exit(3), termios(3)


This page is part of release 3.69 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at http://www.kernel.org/doc/man−pages/.

More Linux Commands

cachemgr.cgi(8) - squid HTTP proxy manager interface........
The cache manager (cachemgr.cgi) is a CGI utility for displaying statistics about the Squid HTTP proxy process as it runs. The cache manager is a convenient way

dot(1) - filter for drawing directed graphs - Linux man page
These are a collection of programs for drawing graphs. There is actually only one main program; the specific layout algorithms implemented as plugins. Thus, the

menu_format(3menu) - set and get menu sizes - Linux man page
menu_format.3menu - The function set_menu_format sets the maximum display size of the given menu. If this size is too small to display all menu items, the menu

ldap_sort_values(3) - LDAP sorting routines (deprecated)....
The ldap_sort_entries(), ldap_sort_values(), and ldap_sort_strcasecmp() are deprecated. Deprecated interfaces generally remain in the library. The macro LDAP_DE

plainrsa-gen(8) - generator for Plain RSA keys (Man Page)...
plainrsa-gen can be used to generate Plain RSA keys for authentication purposes. Using Plain RSA keys is optional. Other possibilities are Pre-shared keys or X.

XF86VidModeGetPermissions(3) - Extension library for the XFr
These functions provide an interface to the server extension XFree86-VidModeExtension which allows the video modes to be queried and adjusted dynamically and mo

TAP::Parser::Result::Unknown(3pm) - Unknown result token....
This is a subclass of TAP::Parser::Result. A token of this class will be returned if the parser does not recognize the token line. For example: 1..5 VERSION 7 o

putchar_unlocked(3) - nonlocking stdio functions (Man Page)
Each of these functions has the same behavior as its counterpart without the _unlocked suffix, except that they do not use locking (they do not set locks themse

reader.conf(5) configuration file for pcscd readers drivers
The /etc/reader.conf.d/reader.conf file contains configuration information for serial and (some) PCMCIA smart card readers. USB readers SHALL NOT be configured

Tcl_GetMathFuncInfo(3) - Define, query and enumerate math fu
Tcl allows a number of mathematical functions to be used in expressions, such as sin, cos, and hypot. These functions are represented by commands in the namespa

cvs(1) - Concurrent Versions System - Linux manual page.....
connection (see node GSSAPI authenticated in the CVS manual) or a Kerberos connection (see node Kerberos authenticated in the CVS manual). Enabling encryption i

lvresize(8) - resize a logical volume - Linux manual page...
lvresize allows you to resize a logical volume. Be careful when reducing a logical volumes size, because data in the reduced part is lost!!! You should therefor

We can't live, work or learn in freedom unless the software we use is free.