.\" This manpage is Copyright (C) 1992 Drew Eckhardt; .\" and Copyright (C) 1993 Michael Haardt, Ian Jackson. .\" .\" %%%LICENSE_START(VERBATIM) .\" 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. .\" %%%LICENSE_END .\" .\" Modified Wed Jul 21 23:02:38 1993 by Rik Faith .\" Modified 2001-11-17, aeb .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" 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 .\" .TH _EXIT 2 2015\-01\-22 Linux "Linux Programmer's Manual" .SH 名前 _exit, _Exit \- 呼び出し元のプロセスを終了させる .SH 書式 \fB#include \fP .sp \fBvoid _exit(int \fP\fIstatus\fP\fB);\fP .sp \fB#include \fP .sp \fBvoid _Exit(int \fP\fIstatus\fP\fB);\fP .sp .in -4n glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l \fB_Exit\fP(): .RS 4 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br または \fIcc\ \-std=c99\fP .RE .ad .SH 説明 \fB_exit\fP() は、それを呼んだプロセスを「直ちに」終了させる。 その際、このプロセスが所有しているディスクリプター (descriptor) で、 オープンされているものは全てクローズされる。 また、このプロセスが所有する子プロセスは全て、プロセス番号 1、 つまり \fIinit\fP プロセスによって継承され、このプロセスの親プロセスに対して \fBSIGCHLD\fP シグナルが送出される。 .LP \fIstatus\fP の値は、このプロセスの終了状態としてその親プロセスに対して返され、 \fBwait\fP(2) 系関数を利用することによって取得することができる。 .LP 関数 \fB_Exit\fP() は \fB_exit\fP() と等価である。 .SH 返り値 これらの関数は値を返さない。 .SH 準拠 SVr4, POSIX.1\-2001, 4.3BSD. 関数 \fB_Exit\fP() は C99 で導入された。 .SH 注意 exit の効果、終了状態の受渡し、ゾンビプロセス、シグナル送出などに ついての議論は、 \fBexit\fP(3) を参照すること。 .LP 関数 \fB_exit\fP() は \fBexit\fP(3) に似ているが、ANSI C の \fBatexit\fP(3) や \fBon_exit\fP(3) によって登録されたいかなる関数も呼び出さない。 標準 I/O バッファーのフラッシュや、 \fBtmpfile\fP(3) で作成されたテンポラリファイルの削除を行うかどうかは、実装に依存する。 一方で、 \fB_exit\fP() はオープンされているファイルディスクリプターをクローズしないため、 未決定になっている出力がフラッシュされるのを待つのに不確定な遅れが発生する。 この遅れを発生させたくなければ、 \fB_exit\fP() の前に \fBtcflush\fP(3) のような関数を呼び出せばよい。 \fB_exit\fP() が呼び出されたときに、 未決定になっている全ての I/O がキャンセルされるのか、 またどの I/O がキャンセルされるのかは実装に依存する。 .SS "C ライブラリとカーネル ABI の違い" バージョン 2.3 より前の glibc では、 \fB_exit\fP() のラッパー関数は同じ名前のカーネルシステムコールを起動していた。 glibc 2.3 以降では、プロセス内の全てのスレッドを終了するために、 ラッパー関数は \fBexit_group\fP(2) を起動する。 .SH 関連項目 \fBexecve\fP(2), \fBexit_group\fP(2), \fBfork\fP(2), \fBkill\fP(2), \fBwait\fP(2), \fBwait4\fP(2), \fBwaitpid\fP(2), \fBatexit\fP(3), \fBexit\fP(3), \fBon_exit\fP(3), \fBtermios\fP(3) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。