.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) .\" and Copyright (c) 2004 by Michael Kerrisk (mtk.manpages@gmail.com) .\" .\" 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. .\" .\" Modified Sat Jul 24 13:32:44 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Mon Jun 23 14:09:52 1997 by aeb - add EINTR. .\" Modified Tue Jul 7 12:26:42 1998 by aeb - changed return value wait3 .\" Modified 2004-11-11, Michael Kerrisk .\" Rewrote much of this page, and removed much duplicated text, .\" replacing with pointers to wait.2 .\" .\" Japanese Version Copyright (c) 1997,1998 HANATAKA Shinya .\" all rights reserved. .\" Translated 1997-03-04, HANATAKA Shinya .\" Modified 1997-09-28, HANATAKA Shinya .\" Modified 2001-08-17, HANATAKA Shinya .\" Updated 2001-12-13, Kentaro Shirakata .\" Updated 2003-09-12, Kentaro Shirakata .\" Updated 2005-03-04, Akihiro MOTOKI .\" .\"WORD: signal handling シグナル処理 .\"WORD: suspend 停止(suspend) .\"WORD: zombie ゾンビ(zombie) .\"WORD: child process 子プロセス .\"WORD: process group プロセス・グループ .\"WORD: process group ID プロセス・グループID .\"WORD: stop 停止(stop) .\"WORD: effective user ID 実効ユーザーID .\"WORD: block 禁止(block) .\"WORD: catch 捕獲(catch) .\"WORD: account アカウント .\" .TH WAIT4 2 2010-09-20 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O wait3, wait4 \- wait for process to change state, BSD style wait3, wait4 \- BSD スタイルでプロセスの状態変化を待つ .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .B #include .B #include .B #include .sp .BI "pid_t wait3(int *" "status" ", int " options , .BI " struct rusage *" rusage ); .sp .BI "pid_t wait4(pid_t " pid ", int *" status ", int " options , .BI " struct rusage *" rusage ); .fi .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 .ad l .BR wait3 (): .RS 4 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .RE .br .BR wait4 (): .RS 4 _BSD_SOURCE .RE .ad .\"O .SH DESCRIPTION .SH 説明 .\"O The .\"O .BR wait3 () .\"O and .\"O .BR wait4 () .\"O system calls are similar to .\"O .BR waitpid (2), .\"O but additionally return resource usage information about the .\"O child in the structure pointed to by .\"O .IR rusage . システムコール .BR wait3 () と .BR wait4 () は .BR waitpid (2) と同様の動作をする。それに加え、子プロセスのリソース使用状況の情報を .I rusage が指す構造体に入れて返す。 .PP .\"O Other than the use of the .\"O .I rusage .\"O argument, the following .\"O .BR wait3 () .\"O call: .\"O .nf .\"O .\"O wait3(status, options, rusage); .\"O .\"O .fi .\"O is equivalent to: .\"O .nf .\"O .\"O waitpid(\-1, status, options); .\"O .\"O .fi .I rusage を使用する点を除けば、以下の 2つは等価である。 .nf wait3(status, options, rusage); waitpid(\-1, status, options); .fi .\"O Similarly, the following .\"O .BR wait4 () .\"O call: .\"O .nf .\"O .\"O wait4(pid, status, options, rusage); .\"O .\"O .fi .\"O is equivalent to: .\"O .nf .\"O .\"O waitpid(pid, status, options); .\"O .\"O .fi 同様に、以下の 2つも等価である。 .nf wait4(pid, status, options, rusage); waitpid(pid, status, options); .fi .\"O In other words, .\"O .BR wait3 () .\"O waits of any child, while .\"O .BR wait4 () .\"O can be used to select a specific child, or children, on which to wait. .\"O See .\"O .BR wait (2) .\"O for further details. 言い換えると、 .BR wait3 () は全ての子プロセスを対象に待つが、 .BR wait4 () では特定の子プロセス (複数可) を選んで待つことができる。 .PP .\"O If .\"O .I rusage .\"O is not NULL, the .\"O .I struct rusage .\"O to which it points will be filled with accounting information .\"O about the child. .\"O See .\"O .BR getrusage (2) .\"O for details. .I rusage が NULL でない場合、 .I rusage が指す .I rusage 構造体 には子プロセスのアカウント情報が格納される。 詳しくは .BR getrusage (2) を参照のこと。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O As for .\"O .BR waitpid (2). .BR waitpid (2) と同様。 .\"O .SH ERRORS .SH エラー .\"O As for .\"O .BR waitpid (2). .BR waitpid (2) と同様。 .\"O .SH "CONFORMING TO" .SH 準拠 4.3BSD. .\"O .SH NOTES .SH 注意 .\"O Including .\"O .I .\"O is not required these days, but increases portability. .\"O (Indeed, .\"O .I .\"O defines the .\"O .I rusage .\"O structure with fields of type .\"O .I struct timeval .\"O defined in .\"O .IR .) 現在では .I をインクルードする必要はないが、インクルードしておくと 移植性を高めることができる (実際には .I で .I rusage 構造体が定義されているが、そのフィールドで使用されている .I struct timeval 型は .I で定義されている)。 .\"O On Linux, .\"O .BR wait3 () .\"O is a library function implemented on top of the .\"O .BR wait4 () .\"O system call. Linux では、 .BR wait3 () はライブラリ関数であり、 .BR wait4 () システムコールを使って実装されている。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR fork (2), .BR getrusage (2), .BR sigaction (2), .BR signal (2), .BR wait (2), .BR signal (7)