1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" This manpage is Copyright (C) 1992 Drew Eckhardt;
4 .\" 1993 Michael Haardt, Ian Jackson.
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.
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.
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
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
26 .\" Modified Wed Jul 21 23:02:38 1993 by Rik Faith <faith@cs.unc.edu>
27 .\" Modified 2001-11-17, aeb
29 .\" Japanese Version Copyright (c) 1997 KUNIMOTO Yasuhiro, all rights reserved.
30 .\" Translated Jun 27, 1997 by KUNIMOTO Yasuhiro (hiro@kthree.co.jp)
31 .\" Modified Jun 28, 1997 by Yoshiki Sugiura (yox@in.aix.or.jp)
32 .\" Modified Jul 6, 1997 by Yoshiki Sugiura (yox@in.aix.or.jp)
33 .\" Updated & Modified Sun Dec 9 20:02:10 JST 2001
34 .\" by Yuichi SATO <ysato@h4.dion.ne.jp>
35 .\" Updated Sat Sep 3 04:26:00 JST 2005
36 .\" by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
38 .\"WORD descriptors ¥Ç¥£¥¹¥¯¥ê¥×¥¿
40 .TH _EXIT 2 2010-09-20 "Linux" "Linux Programmer's Manual"
43 .\"O _exit, _Exit \- terminate the calling process
44 _exit, _Exit \- ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤ë
47 .B #include <unistd.h>
49 .BI "void _exit(int " status );
51 .B #include <stdlib.h>
53 .BI "void _Exit(int " status );
56 .\"O Feature Test Macro Requirements for glibc (see
57 .\"O .BR feature_test_macros (7)):
58 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
59 .RB ( feature_test_macros (7)
66 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
67 _POSIX_C_SOURCE\ >=\ 200112L;
77 .\"O terminates the calling process "immediately".
78 .\"O Any open file descriptors
79 .\"O belonging to the process are closed; any children of the process are
80 .\"O inherited by process 1,
82 .\"O and the process's parent is sent a
86 ¤Ï¡¢¤½¤ì¤ò¸Æ¤ó¤À¥×¥í¥»¥¹¤ò¡Öľ¤Á¤Ë¡×½ªÎ»¤µ¤»¤ë¡£
87 ¤½¤ÎºÝ¡¢¤³¤Î¥×¥í¥»¥¹¤¬½êͤ·¤Æ¤¤¤ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ (descriptor) ¤Ç¡¢
88 ¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤ÏÁ´¤Æ¥¯¥í¡¼¥º¤µ¤ì¤ë¡£
89 ¤Þ¤¿¡¢¤³¤Î¥×¥í¥»¥¹¤¬½êͤ¹¤ë»Ò¥×¥í¥»¥¹¤ÏÁ´¤Æ¡¢¥×¥í¥»¥¹ÈÖ¹æ 1¡¢
92 ¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ·Ñ¾µ¤µ¤ì¡¢¤³¤Î¥×¥í¥»¥¹¤Î¿Æ¥×¥í¥»¥¹¤ËÂФ·¤Æ
94 ¥·¥°¥Ê¥ë¤¬Á÷½Ð¤µ¤ì¤ë¡£
98 .\"O is returned to the parent process as the process's exit status, and
99 .\"O can be collected using one of the
101 .\"O family of calls.
103 ¤ÎÃͤϡ¢¤³¤Î¥×¥í¥»¥¹¤Î½ªÎ»¾õÂ֤Ȥ·¤Æ¤½¤Î¿Æ¥×¥í¥»¥¹¤ËÂФ·¤ÆÊÖ¤µ¤ì¡¢
105 ·Ï´Ø¿ô¤òÍøÍѤ¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¼èÆÀ¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£
109 .\"O is equivalent to
116 .\"O .SH "RETURN VALUE"
118 .\"O These functions do not return.
119 ¤³¤ì¤é¤Î´Ø¿ô¤ÏÃͤòÊÖ¤µ¤Ê¤¤¡£
120 .\"O .SH "CONFORMING TO"
122 SVr4, POSIX.1-2001, 4.3BSD.
125 .\"O was introduced by C99.
128 ¤Ï C99 ¤ÇƳÆþ¤µ¤ì¤¿¡£
131 .\"O For a discussion on the effects of an exit, the transmission of
132 .\"O exit status, zombie processes, signals sent, etc., see
134 exit ¤ÎÌò³ä¡¦½ªÎ»¾õÂ֤μõÅϤ·¡¦
135 ¥¾¥ó¥Ó¥×¥í¥»¥¹¡¦¥·¥°¥Ê¥ëÁ÷½Ð¤Ê¤É¤Ë¤Ä¤¤¤Æ¤ÎµÄÏÀ¤Ï¡¢
143 .\"O but does not call any
144 .\"O functions registered with
147 .\"O .BR on_exit (3).
148 .\"O Whether it flushes
149 .\"O standard I/O buffers and removes temporary files created with
151 .\"O is implementation-dependent.
156 ¤Ë»÷¤Æ¤¤¤ë¤¬¡¢ANSI C ¤Î
160 ¤Ë¤è¤Ã¤ÆÅÐÏ¿¤µ¤ì¤¿¤¤¤«¤Ê¤ë´Ø¿ô¤â¸Æ¤Ó½Ð¤µ¤Ê¤¤¡£
161 ɸ½à I/O ¥Ð¥Ã¥Õ¥¡¤Î¥Õ¥é¥Ã¥·¥å¤ä¡¢
163 ¤ÇºîÀ®¤µ¤ì¤¿¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤Îºï½ü¤ò¹Ô¤¦¤«¤É¤¦¤«¤Ï¡¢¼ÂÁõ¤Ë°Í¸¤¹¤ë¡£
164 .\"O On the other hand,
166 .\"O does close open file descriptors, and this may cause an unknown delay,
167 .\"O waiting for pending output to finish.
168 .\"O If the delay is undesired,
169 .\"O it may be useful to call functions like
173 .\"O Whether any pending I/O is canceled, and which pending I/O may be
176 .\"O is implementation-dependent.
179 ¤Ï¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¤¿¤á¡¢
180 ̤·èÄê¤Ë¤Ê¤Ã¤Æ¤¤¤ë½ÐÎϤ¬¥Õ¥é¥Ã¥·¥å¤µ¤ì¤ë¤Î¤òÂԤĤΤËÉÔ³ÎÄê¤ÊÃ٤줬ȯÀ¸¤¹¤ë¡£
181 ¤³¤ÎÃÙ¤ì¤òȯÀ¸¤µ¤»¤¿¤¯¤Ê¤±¤ì¤Ð¡¢
185 ¤Î¤è¤¦¤Ê´Ø¿ô¤ò¸Æ¤Ó½Ð¤»¤Ð¤è¤¤¡£
187 ¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¤È¤¤Ë¡¢
188 ̤·èÄê¤Ë¤Ê¤Ã¤Æ¤¤¤ëÁ´¤Æ¤Î I/O ¤¬¥¥ã¥ó¥»¥ë¤µ¤ì¤ë¤Î¤«¡¢
189 ¤Þ¤¿¤É¤Î I/O ¤¬¥¥ã¥ó¥»¥ë¤µ¤ì¤ë¤Î¤«¤Ï¼ÂÁõ¤Ë°Í¸¤¹¤ë¡£
191 .\"O In glibc up to version 2.3, the
193 .\"O wrapper function invoked the kernel system call of the same name.
194 .\"O Since glibc 2.3, the wrapper function invokes
195 .\"O .BR exit_group (2),
196 .\"O in order to terminate all of the threads in a process.
197 ¥Ð¡¼¥¸¥ç¥ó 2.3 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢
199 ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤ÏƱ¤¸Ì¾Á°¤Î¥«¡¼¥Í¥ë¡¦¥·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤·¤Æ¤¤¤¿¡£
200 glibc 2.3 °Ê¹ß¤Ç¤Ï¡¢¥×¥í¥»¥¹Æâ¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤ò½ªÎ»¤¹¤ë¤¿¤á¤Ë¡¢