.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" This manpage is Copyright (C) 1992 Drew Eckhardt; .\" 1993 Michael Haardt, Ian Jackson. .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" Modified Wed Jul 21 23:02:38 1993 by Rik Faith .\" Modified 2001-11-17, aeb .\" .\" Japanese Version Copyright (c) 1997 KUNIMOTO Yasuhiro, all rights reserved. .\" Translated Jun 27, 1997 by KUNIMOTO Yasuhiro (hiro@kthree.co.jp) .\" .\" Modified Jun 28, 1997 by Yoshiki Sugiura (yox@in.aix.or.jp) .\" Modified Jul 6, 1997 by Yoshiki Sugiura (yox@in.aix.or.jp) .\" Updated & Modified Sun Dec 9 20:02:10 JST 2001 .\" by Yuichi SATO .\" Updated Sat Sep 3 04:26:00 JST 2005 .\" by Akihiro MOTOKI .\" .\"WORD descriptors ディスクリプタ .\" .TH _EXIT 2 2008-11-27 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O _exit, _Exit \- terminate the calling process _exit, _Exit \- 呼び出し元のプロセスを終了させる .\"O .SH SYNOPSIS .SH 書式 .B #include .sp .BI "void _exit(int " status ); .sp .B #include .sp .BI "void _Exit(int " status ); .sp .in -4n .\"O Feature Test Macro Requirements for glibc (see .\"O .BR feature_test_macros (7)): glibc 向けの機能検査マクロの要件 .RB ( feature_test_macros (7) 参照): .in .sp .BR _Exit (): .\"O _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; または .I cc\ -std=c99 .\"O .SH DESCRIPTION .SH 説明 .\"O The function .\"O .BR _exit () .\"O terminates the calling process "immediately". .\"O Any open file descriptors .\"O belonging to the process are closed; any children of the process are .\"O inherited by process 1, .\"O .IR init , .\"O and the process's parent is sent a .\"O .B SIGCHLD .\"O signal. .BR _exit () は、それを呼んだプロセスを「直ちに」終了させる。 その際、このプロセスが所有しているディスクリプタ (descriptor) で、 オープンされているものは全てクローズされる。 また、このプロセスが所有する子プロセスは全て、プロセス番号 1、 つまり .I init プロセスによって継承され、このプロセスの親プロセスに対して .B SIGCHLD シグナルが送出される。 .LP .\"O The value .\"O .I status .\"O is returned to the parent process as the process's exit status, and .\"O can be collected using one of the .\"O .BR wait 2() .\"O family of calls. .I status の値は、このプロセスの終了状態としてその親プロセスに対して返され、 .BR wait (2) 系関数を利用することによって取得することができる。 .LP .\"O The function .\"O .BR _Exit () .\"O is equivalent to .\"O .BR _exit (). 関数 .BR _Exit () は .BR _exit () と等価である。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O These functions do not return. これらの関数は値を返さない。 .\"O .SH "CONFORMING TO" .SH 準拠 SVr4, POSIX.1-2001, 4.3BSD. .\"O The function .\"O .BR _Exit () .\"O was introduced by C99. 関数 .BR _Exit () は C99 で導入された。 .\"O .SH NOTES .SH 注意 .\"O For a discussion on the effects of an exit, the transmission of .\"O exit status, zombie processes, signals sent, etc., see .\"O .BR exit (3). exit の役割・終了状態の受渡し・ ゾンビプロセス・シグナル送出などについての議論は、 .BR exit (3) を参照すること。 .LP .\"O The function .\"O .BR _exit () .\"O is like .\"O .BR exit (3), .\"O but does not call any .\"O functions registered with .\"O .BR atexit (3) .\"O or .\"O .BR on_exit (3). .\"O Whether it flushes .\"O standard I/O buffers and removes temporary files created with .\"O .BR tmpfile (3) .\"O is implementation-dependent. 関数 .BR _exit () は .BR exit (3) に似ているが、ANSI C の .BR atexit (3) や .BR on_exit (3) によって登録されたいかなる関数も呼び出さない。 標準 I/O バッファのフラッシュや、 .BR tmpfile (3) で作成されたテンポラリファイルの削除を行うかどうかは、実装に依存する。 .\"O On the other hand, .\"O .BR _exit () .\"O does close open file descriptors, and this may cause an unknown delay, .\"O waiting for pending output to finish. .\"O If the delay is undesired, .\"O it may be useful to call functions like .\"O .BR tcflush (3) .\"O before calling .\"O .BR _exit (). .\"O Whether any pending I/O is canceled, and which pending I/O may be .\"O canceled upon .\"O .BR _exit (), .\"O is implementation-dependent. 一方で、 .BR _exit () はオープンされているファイルディスクリプタをクローズしないため、 未決定になっている出力がフラッシュされるのを待つのに不確定な遅れが発生する。 この遅れを発生させたくなければ、 .BR _exit () の前に .BR tcflush (3) のような関数を呼び出せばよい。 .BR _exit () が呼び出されたときに、 未決定になっている全ての I/O がキャンセルされるのか、 またどの I/O がキャンセルされるのかは実装に依存する。 .\"O In glibc up to version 2.3, the .\"O .BR _exit () .\"O wrapper function invoked the kernel system call of the same name. .\"O Since glibc 2.3, the wrapper function invokes .\"O .BR exit_group (2), .\"O in order to terminate all of the threads in a process. バージョン 2.3 より前の glibc では、 .BR _exit () のラッパー関数は同じ名前のカーネル・システムコールを起動していた。 glibc 2.3 以降では、プロセス内の全てのスレッドを終了するために、 ラッパー関数は .BR exit_group (2) を起動する。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR execve (2), .BR exit_group (2), .BR fork (2), .BR kill (2), .BR wait (2), .BR wait4 (2), .BR waitpid (2), .BR atexit (3), .BR exit (3), .BR on_exit (3), .BR termios (3)