1_EXIT(2) Linux Programmer's Manual _EXIT(2)
2
3
4
6 _exit, _Exit - terminate the current process
7
9 #include <unistd.h>
10
11 void _exit(int status);
12
13 #include <stdlib.h>
14
15 void _Exit(int status);
16
18 The function _exit() terminates the calling process "immediately". Any
19 open file descriptors belonging to the process are closed; any children
20 of the process are inherited by process 1, init, and the process's par‐
21 ent is sent a SIGCHLD signal.
22
23 The value status is returned to the parent process as the process's
24 exit status, and can be collected using one of the wait() family of
25 calls.
26
27 The function _Exit() is equivalent to _exit().
28
30 These functions do not return.
31
33 SVr4, POSIX.1-2001, 4.3BSD. The function _Exit() was introduced by
34 C99.
35
37 For a discussion on the effects of an exit, the transmission of exit
38 status, zombie processes, signals sent, etc., see exit(3).
39
40 The function _exit() is like exit(), but does not call any functions
41 registered with atexit() or on_exit(). Whether it flushes standard I/O
42 buffers and removes temporary files created with tmpfile(3) is imple‐
43 mentation dependent. On the other hand, _exit() does close open file
44 descriptors, and this may cause an unknown delay, waiting for pending
45 output to finish. If the delay is undesired, it may be useful to call
46 functions like tcflush() before calling _exit(). Whether any pending
47 I/O is cancelled, and which pending I/O may be cancelled upon _exit(),
48 is implementation-dependent.
49
51 execve(2), exit_group(2), fork(2), kill(2), wait(2), wait4(2), wait‐
52 pid(2), atexit(3), exit(3), on_exit(3), termios(3)
53
54
55
56Linux 2001-11-17 _EXIT(2)