]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/_exit.2
Fix inconsistencies in .TH line
[thirdparty/man-pages.git] / man2 / _exit.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" This manpage is Copyright (C) 1992 Drew Eckhardt;
4 .\" 1993 Michael Haardt, Ian Jackson.
5 .\"
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date. The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein. The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\"
26 .\" Modified Wed Jul 21 23:02:38 1993 by Rik Faith <faith@cs.unc.edu>
27 .\" Modified 2001-11-17, aeb
28 .\"
29 .TH _EXIT 2 2001-11-17 "Linux" "Linux Programmer's Manual"
30 .SH NAME
31 _exit, _Exit \- terminate the current process
32 .SH SYNOPSIS
33 .B #include <unistd.h>
34 .sp
35 .BI "void _exit(int " status );
36 .sp
37 .B #include <stdlib.h>
38 .sp
39 .BI "void _Exit(int " status );
40 .SH DESCRIPTION
41 The function
42 .BR _exit ()
43 terminates the calling process "immediately".
44 Any open file descriptors
45 belonging to the process are closed; any children of the process are
46 inherited by process 1,
47 .IR init ,
48 and the process's parent is sent a
49 .B SIGCHLD
50 signal.
51 .LP
52 The value
53 .I status
54 is returned to the parent process as the process's exit status, and
55 can be collected using one of the
56 .BR wait (2)
57 family of calls.
58 .LP
59 The function
60 .BR _Exit ()
61 is equivalent to
62 .BR _exit ().
63 .SH "RETURN VALUE"
64 These functions do not return.
65 .SH "CONFORMING TO"
66 SVr4, POSIX.1-2001, 4.3BSD.
67 The function
68 .BR _Exit ()
69 was introduced by C99.
70 .SH NOTES
71 For a discussion on the effects of an exit, the transmission of
72 exit status, zombie processes, signals sent, etc., see
73 .BR exit (3).
74 .LP
75 The function
76 .BR _exit ()
77 is like
78 .BR exit (3),
79 but does not call any
80 functions registered with
81 .BR atexit (3)
82 or
83 .BR on_exit (3).
84 Whether it flushes
85 standard I/O buffers and removes temporary files created with
86 .BR tmpfile (3)
87 is implementation dependent.
88 On the other hand,
89 .BR _exit ()
90 does close open file descriptors, and this may cause an unknown delay,
91 waiting for pending output to finish.
92 If the delay is undesired,
93 it may be useful to call functions like
94 .BR tcflush (3)
95 before calling
96 .BR _exit ().
97 Whether any pending I/O is cancelled, and which pending I/O may be
98 cancelled upon
99 .BR _exit (),
100 is implementation-dependent.
101 .SH "SEE ALSO"
102 .BR execve (2),
103 .BR exit_group (2),
104 .BR fork (2),
105 .BR kill (2),
106 .BR wait (2),
107 .BR wait4 (2),
108 .BR waitpid (2),
109 .BR atexit (3),
110 .BR exit (3),
111 .BR on_exit (3),
112 .BR termios (3)