OSDN Git Service

83f09e504e6b05fc39637e65b9937c9fb214f078
[linuxjm/LDP_man-pages.git] / draft / 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 .\" Japanese Version Copyright (c) 1997 KUNIMOTO Yasuhiro, all rights reserved.
30 .\" Translated Jun 27, 1997 by KUNIMOTO Yasuhiro (hiro@kthree.co.jp)
31 .\"
32 .\" Modified  Jun 28, 1997 by Yoshiki Sugiura (yox@in.aix.or.jp)
33 .\" Modified  Jul  6, 1997 by Yoshiki Sugiura (yox@in.aix.or.jp)
34 .\" Updated & Modified Sun Dec  9 20:02:10 JST 2001
35 .\"         by Yuichi SATO <ysato@h4.dion.ne.jp>
36 .\" Updated Sat Sep  3 04:26:00 JST 2005
37 .\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
38 .\"
39 .\"WORD     descriptors ¥Ç¥£¥¹¥¯¥ê¥×¥¿
40 .\"
41 .TH _EXIT 2 2010-09-20 "Linux" "Linux Programmer's Manual"
42 .\"O .SH NAME
43 .SH Ì¾Á°
44 .\"O _exit, _Exit \- terminate the calling process
45 _exit, _Exit \- ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤ë
46 .\"O .SH SYNOPSIS
47 .SH ½ñ¼°
48 .B #include <unistd.h>
49 .sp
50 .BI "void _exit(int " status );
51 .sp
52 .B #include <stdlib.h>
53 .sp
54 .BI "void _Exit(int " status );
55 .sp
56 .in -4n
57 .\"O Feature Test Macro Requirements for glibc (see
58 .\"O .BR feature_test_macros (7)):
59 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
60 .RB ( feature_test_macros (7)
61 »²¾È):
62 .in
63 .sp
64 .ad l
65 .BR _Exit ():
66 .RS 4
67 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
68 _POSIX_C_SOURCE\ >=\ 200112L;
69 .br
70 .\"O or
71 ¤Þ¤¿¤Ï
72 .I cc\ -std=c99
73 .ad
74 .\"O .SH DESCRIPTION
75 .SH ÀâÌÀ
76 .\"O The function
77 .\"O .BR _exit ()
78 .\"O terminates the calling process "immediately".
79 .\"O Any open file descriptors
80 .\"O belonging to the process are closed; any children of the process are
81 .\"O inherited by process 1,
82 .\"O .IR init ,
83 .\"O and the process's parent is sent a
84 .\"O .B SIGCHLD
85 .\"O signal.
86 .BR _exit ()
87 ¤Ï¡¢¤½¤ì¤ò¸Æ¤ó¤À¥×¥í¥»¥¹¤ò¡Öľ¤Á¤Ë¡×½ªÎ»¤µ¤»¤ë¡£
88 ¤½¤ÎºÝ¡¢¤³¤Î¥×¥í¥»¥¹¤¬½êÍ­¤·¤Æ¤¤¤ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ (descriptor) ¤Ç¡¢
89 ¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤ÏÁ´¤Æ¥¯¥í¡¼¥º¤µ¤ì¤ë¡£
90 ¤Þ¤¿¡¢¤³¤Î¥×¥í¥»¥¹¤¬½êÍ­¤¹¤ë»Ò¥×¥í¥»¥¹¤ÏÁ´¤Æ¡¢¥×¥í¥»¥¹ÈÖ¹æ 1¡¢
91 ¤Ä¤Þ¤ê
92 .I init
93 ¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ·Ñ¾µ¤µ¤ì¡¢¤³¤Î¥×¥í¥»¥¹¤Î¿Æ¥×¥í¥»¥¹¤ËÂФ·¤Æ
94 .B SIGCHLD
95 ¥·¥°¥Ê¥ë¤¬Á÷½Ð¤µ¤ì¤ë¡£
96 .LP
97 .\"O The value
98 .\"O .I status
99 .\"O is returned to the parent process as the process's exit status, and
100 .\"O can be collected using one of the
101 .\"O .BR wait 2()
102 .\"O family of calls.
103 .I status
104 ¤ÎÃͤϡ¢¤³¤Î¥×¥í¥»¥¹¤Î½ªÎ»¾õÂ֤Ȥ·¤Æ¤½¤Î¿Æ¥×¥í¥»¥¹¤ËÂФ·¤ÆÊÖ¤µ¤ì¡¢
105 .BR wait (2)
106 ·Ï´Ø¿ô¤òÍøÍѤ¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¼èÆÀ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
107 .LP
108 .\"O The function
109 .\"O .BR _Exit ()
110 .\"O is equivalent to
111 .\"O .BR _exit ().
112 ´Ø¿ô
113 .BR _Exit ()
114 ¤Ï
115 .BR _exit ()
116 ¤ÈÅù²Á¤Ç¤¢¤ë¡£
117 .\"O .SH "RETURN VALUE"
118 .SH ÊÖ¤êÃÍ
119 .\"O These functions do not return.
120 ¤³¤ì¤é¤Î´Ø¿ô¤ÏÃͤòÊÖ¤µ¤Ê¤¤¡£
121 .\"O .SH "CONFORMING TO"
122 .SH ½àµò
123 SVr4, POSIX.1-2001, 4.3BSD.
124 .\"O The function
125 .\"O .BR _Exit ()
126 .\"O was introduced by C99.
127 ´Ø¿ô
128 .BR _Exit ()
129 ¤Ï C99 ¤ÇƳÆþ¤µ¤ì¤¿¡£
130 .\"O .SH NOTES
131 .SH Ãí°Õ
132 .\"O For a discussion on the effects of an exit, the transmission of
133 .\"O exit status, zombie processes, signals sent, etc., see
134 .\"O .BR exit (3).
135 exit ¤ÎÌò³ä¡¦½ªÎ»¾õÂ֤μõÅϤ·¡¦
136 ¥¾¥ó¥Ó¥×¥í¥»¥¹¡¦¥·¥°¥Ê¥ëÁ÷½Ð¤Ê¤É¤Ë¤Ä¤¤¤Æ¤ÎµÄÏÀ¤Ï¡¢
137 .BR exit (3)
138 ¤ò»²¾È¤¹¤ë¤³¤È¡£
139 .LP
140 .\"O The function
141 .\"O .BR _exit ()
142 .\"O is like
143 .\"O .BR exit (3),
144 .\"O but does not call any
145 .\"O functions registered with
146 .\"O .BR atexit (3)
147 .\"O or
148 .\"O .BR on_exit (3).
149 .\"O Whether it flushes
150 .\"O standard I/O buffers and removes temporary files created with
151 .\"O .BR tmpfile (3)
152 .\"O is implementation-dependent.
153 ´Ø¿ô
154 .BR _exit ()
155 ¤Ï
156 .BR exit (3)
157 ¤Ë»÷¤Æ¤¤¤ë¤¬¡¢ANSI C ¤Î
158 .BR atexit (3)
159 ¤ä
160 .BR on_exit (3)
161 ¤Ë¤è¤Ã¤ÆÅÐÏ¿¤µ¤ì¤¿¤¤¤«¤Ê¤ë´Ø¿ô¤â¸Æ¤Ó½Ð¤µ¤Ê¤¤¡£
162 ɸ½à I/O ¥Ð¥Ã¥Õ¥¡¤Î¥Õ¥é¥Ã¥·¥å¤ä¡¢
163 .BR tmpfile (3)
164 ¤ÇºîÀ®¤µ¤ì¤¿¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤Îºï½ü¤ò¹Ô¤¦¤«¤É¤¦¤«¤Ï¡¢¼ÂÁõ¤Ë°Í¸¤¹¤ë¡£
165 .\"O On the other hand,
166 .\"O .BR _exit ()
167 .\"O does close open file descriptors, and this may cause an unknown delay,
168 .\"O waiting for pending output to finish.
169 .\"O If the delay is undesired,
170 .\"O it may be useful to call functions like
171 .\"O .BR tcflush (3)
172 .\"O before calling
173 .\"O .BR _exit ().
174 .\"O Whether any pending I/O is canceled, and which pending I/O may be
175 .\"O canceled upon
176 .\"O .BR _exit (),
177 .\"O is implementation-dependent.
178 °ìÊý¤Ç¡¢
179 .BR _exit ()
180 ¤Ï¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¤¿¤á¡¢
181 ̤·èÄê¤Ë¤Ê¤Ã¤Æ¤¤¤ë½ÐÎϤ¬¥Õ¥é¥Ã¥·¥å¤µ¤ì¤ë¤Î¤òÂԤĤΤËÉÔ³ÎÄê¤ÊÃ٤줬ȯÀ¸¤¹¤ë¡£
182 ¤³¤ÎÃÙ¤ì¤òȯÀ¸¤µ¤»¤¿¤¯¤Ê¤±¤ì¤Ð¡¢
183 .BR _exit ()
184 ¤ÎÁ°¤Ë
185 .BR tcflush (3)
186 ¤Î¤è¤¦¤Ê´Ø¿ô¤ò¸Æ¤Ó½Ð¤»¤Ð¤è¤¤¡£
187 .BR _exit ()
188 ¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¤È¤­¤Ë¡¢
189 ̤·èÄê¤Ë¤Ê¤Ã¤Æ¤¤¤ëÁ´¤Æ¤Î I/O ¤¬¥­¥ã¥ó¥»¥ë¤µ¤ì¤ë¤Î¤«¡¢
190 ¤Þ¤¿¤É¤Î I/O ¤¬¥­¥ã¥ó¥»¥ë¤µ¤ì¤ë¤Î¤«¤Ï¼ÂÁõ¤Ë°Í¸¤¹¤ë¡£
191
192 .\"O In glibc up to version 2.3, the
193 .\"O .BR _exit ()
194 .\"O wrapper function invoked the kernel system call of the same name.
195 .\"O Since glibc 2.3, the wrapper function invokes
196 .\"O .BR exit_group (2),
197 .\"O in order to terminate all of the threads in a process.
198 ¥Ð¡¼¥¸¥ç¥ó 2.3 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢
199 .BR _exit ()
200 ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤ÏƱ¤¸Ì¾Á°¤Î¥«¡¼¥Í¥ë¡¦¥·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤·¤Æ¤¤¤¿¡£
201 glibc 2.3 °Ê¹ß¤Ç¤Ï¡¢¥×¥í¥»¥¹Æâ¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤ò½ªÎ»¤¹¤ë¤¿¤á¤Ë¡¢
202 ¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï
203 .BR exit_group (2)
204 ¤òµ¯Æ°¤¹¤ë¡£
205 .\"O .SH "SEE ALSO"
206 .SH ´ØÏ¢¹àÌÜ
207 .BR execve (2),
208 .BR exit_group (2),
209 .BR fork (2),
210 .BR kill (2),
211 .BR wait (2),
212 .BR wait4 (2),
213 .BR waitpid (2),
214 .BR atexit (3),
215 .BR exit (3),
216 .BR on_exit (3),
217 .BR termios (3)