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)
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>
39 .\"WORD descriptors ¥Ç¥£¥¹¥¯¥ê¥×¥¿
41 .TH _EXIT 2 2010-09-20 "Linux" "Linux Programmer's Manual"
44 .\"O _exit, _Exit \- terminate the calling process
45 _exit, _Exit \- ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤ë
48 .B #include <unistd.h>
50 .BI "void _exit(int " status );
52 .B #include <stdlib.h>
54 .BI "void _Exit(int " status );
57 .\"O Feature Test Macro Requirements for glibc (see
58 .\"O .BR feature_test_macros (7)):
59 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
60 .RB ( feature_test_macros (7)
67 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
68 _POSIX_C_SOURCE\ >=\ 200112L;
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,
83 .\"O and the process's parent is sent a
87 ¤Ï¡¢¤½¤ì¤ò¸Æ¤ó¤À¥×¥í¥»¥¹¤ò¡Öľ¤Á¤Ë¡×½ªÎ»¤µ¤»¤ë¡£
88 ¤½¤ÎºÝ¡¢¤³¤Î¥×¥í¥»¥¹¤¬½êͤ·¤Æ¤¤¤ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ (descriptor) ¤Ç¡¢
89 ¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤ÏÁ´¤Æ¥¯¥í¡¼¥º¤µ¤ì¤ë¡£
90 ¤Þ¤¿¡¢¤³¤Î¥×¥í¥»¥¹¤¬½êͤ¹¤ë»Ò¥×¥í¥»¥¹¤ÏÁ´¤Æ¡¢¥×¥í¥»¥¹ÈÖ¹æ 1¡¢
93 ¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ·Ñ¾µ¤µ¤ì¡¢¤³¤Î¥×¥í¥»¥¹¤Î¿Æ¥×¥í¥»¥¹¤ËÂФ·¤Æ
95 ¥·¥°¥Ê¥ë¤¬Á÷½Ð¤µ¤ì¤ë¡£
99 .\"O is returned to the parent process as the process's exit status, and
100 .\"O can be collected using one of the
102 .\"O family of calls.
104 ¤ÎÃͤϡ¢¤³¤Î¥×¥í¥»¥¹¤Î½ªÎ»¾õÂ֤Ȥ·¤Æ¤½¤Î¿Æ¥×¥í¥»¥¹¤ËÂФ·¤ÆÊÖ¤µ¤ì¡¢
106 ·Ï´Ø¿ô¤òÍøÍѤ¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¼èÆÀ¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£
110 .\"O is equivalent to
117 .\"O .SH "RETURN VALUE"
119 .\"O These functions do not return.
120 ¤³¤ì¤é¤Î´Ø¿ô¤ÏÃͤòÊÖ¤µ¤Ê¤¤¡£
121 .\"O .SH "CONFORMING TO"
123 SVr4, POSIX.1-2001, 4.3BSD.
126 .\"O was introduced by C99.
129 ¤Ï C99 ¤ÇƳÆþ¤µ¤ì¤¿¡£
132 .\"O For a discussion on the effects of an exit, the transmission of
133 .\"O exit status, zombie processes, signals sent, etc., see
135 exit ¤ÎÌò³ä¡¦½ªÎ»¾õÂ֤μõÅϤ·¡¦
136 ¥¾¥ó¥Ó¥×¥í¥»¥¹¡¦¥·¥°¥Ê¥ëÁ÷½Ð¤Ê¤É¤Ë¤Ä¤¤¤Æ¤ÎµÄÏÀ¤Ï¡¢
144 .\"O but does not call any
145 .\"O functions registered with
148 .\"O .BR on_exit (3).
149 .\"O Whether it flushes
150 .\"O standard I/O buffers and removes temporary files created with
152 .\"O is implementation-dependent.
157 ¤Ë»÷¤Æ¤¤¤ë¤¬¡¢ANSI C ¤Î
161 ¤Ë¤è¤Ã¤ÆÅÐÏ¿¤µ¤ì¤¿¤¤¤«¤Ê¤ë´Ø¿ô¤â¸Æ¤Ó½Ð¤µ¤Ê¤¤¡£
162 ɸ½à I/O ¥Ð¥Ã¥Õ¥¡¤Î¥Õ¥é¥Ã¥·¥å¤ä¡¢
164 ¤ÇºîÀ®¤µ¤ì¤¿¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤Îºï½ü¤ò¹Ô¤¦¤«¤É¤¦¤«¤Ï¡¢¼ÂÁõ¤Ë°Í¸¤¹¤ë¡£
165 .\"O On the other hand,
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
174 .\"O Whether any pending I/O is canceled, and which pending I/O may be
177 .\"O is implementation-dependent.
180 ¤Ï¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¤¿¤á¡¢
181 ̤·èÄê¤Ë¤Ê¤Ã¤Æ¤¤¤ë½ÐÎϤ¬¥Õ¥é¥Ã¥·¥å¤µ¤ì¤ë¤Î¤òÂԤĤΤËÉÔ³ÎÄê¤ÊÃ٤줬ȯÀ¸¤¹¤ë¡£
182 ¤³¤ÎÃÙ¤ì¤òȯÀ¸¤µ¤»¤¿¤¯¤Ê¤±¤ì¤Ð¡¢
186 ¤Î¤è¤¦¤Ê´Ø¿ô¤ò¸Æ¤Ó½Ð¤»¤Ð¤è¤¤¡£
188 ¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¤È¤¤Ë¡¢
189 ̤·èÄê¤Ë¤Ê¤Ã¤Æ¤¤¤ëÁ´¤Æ¤Î I/O ¤¬¥¥ã¥ó¥»¥ë¤µ¤ì¤ë¤Î¤«¡¢
190 ¤Þ¤¿¤É¤Î I/O ¤¬¥¥ã¥ó¥»¥ë¤µ¤ì¤ë¤Î¤«¤Ï¼ÂÁõ¤Ë°Í¸¤¹¤ë¡£
192 .\"O In glibc up to version 2.3, the
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 ¤Ç¤Ï¡¢
200 ¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤ÏƱ¤¸Ì¾Á°¤Î¥«¡¼¥Í¥ë¡¦¥·¥¹¥Æ¥à¥³¡¼¥ë¤òµ¯Æ°¤·¤Æ¤¤¤¿¡£
201 glibc 2.3 °Ê¹ß¤Ç¤Ï¡¢¥×¥í¥»¥¹Æâ¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤ò½ªÎ»¤¹¤ë¤¿¤á¤Ë¡¢