1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
4 .\" and Copyright (c) 2004 by Michael Kerrisk (mtk.manpages@gmail.com)
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.
27 .\" Modified Sat Jul 24 13:32:44 1993 by Rik Faith (faith@cs.unc.edu)
28 .\" Modified Mon Jun 23 14:09:52 1997 by aeb - add EINTR.
29 .\" Modified Tue Jul 7 12:26:42 1998 by aeb - changed return value wait3
30 .\" Modified 2004-11-11, Michael Kerrisk <mtk.manpages@gmail.com>
31 .\" Rewrote much of this page, and removed much duplicated text,
32 .\" replacing with pointers to wait.2
34 .\" Japanese Version Copyright (c) 1997,1998 HANATAKA Shinya
35 .\" all rights reserved.
36 .\" Translated 1997-03-04, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
37 .\" Modified 1997-09-28, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
38 .\" Modified 2001-08-17, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
39 .\" Updated 2001-12-13, Kentaro Shirakata <argrath@ub32.org>
40 .\" Updated 2003-09-12, Kentaro Shirakata <argrath@ub32.org>
41 .\" Updated 2005-03-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
43 .\"WORD: signal handling シグナル処理
44 .\"WORD: suspend 停止(suspend)
45 .\"WORD: zombie ゾンビ(zombie)
46 .\"WORD: child process 子プロセス
47 .\"WORD: process group プロセス・グループ
48 .\"WORD: process group ID プロセス・グループID
49 .\"WORD: stop 停止(stop)
50 .\"WORD: effective user ID 実効ユーザーID
51 .\"WORD: block 禁止(block)
52 .\"WORD: catch 捕獲(catch)
53 .\"WORD: account アカウント
55 .TH WAIT4 2 2010-09-20 "Linux" "Linux Programmer's Manual"
58 .\"O wait3, wait4 \- wait for process to change state, BSD style
59 wait3, wait4 \- BSD スタイルでプロセスの状態変化を待つ
63 .B #include <sys/types.h>
64 .B #include <sys/time.h>
65 .B #include <sys/resource.h>
66 .B #include <sys/wait.h>
68 .BI "pid_t wait3(int *" "status" ", int " options ,
69 .BI " struct rusage *" rusage );
71 .BI "pid_t wait4(pid_t " pid ", int *" status ", int " options ,
72 .BI " struct rusage *" rusage );
76 .\"O Feature Test Macro Requirements for glibc (see
77 .\"O .BR feature_test_macros (7)):
79 .RB ( feature_test_macros (7)
86 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
87 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
101 .\"O system calls are similar to
102 .\"O .BR waitpid (2),
103 .\"O but additionally return resource usage information about the
104 .\"O child in the structure pointed to by
112 と同様の動作をする。それに加え、子プロセスのリソース使用状況の情報を
116 .\"O Other than the use of the
118 .\"O argument, the following
123 .\"O wait3(status, options, rusage);
126 .\"O is equivalent to:
129 .\"O waitpid(\-1, status, options);
133 を使用する点を除けば、以下の 2つは等価である。
136 wait3(status, options, rusage);
138 waitpid(\-1, status, options);
141 .\"O Similarly, the following
146 .\"O wait4(pid, status, options, rusage);
149 .\"O is equivalent to:
152 .\"O waitpid(pid, status, options);
158 wait4(pid, status, options, rusage);
160 waitpid(pid, status, options);
165 .\"O waits of any child, while
167 .\"O can be used to select a specific child, or children, on which to wait.
170 .\"O for further details.
175 では特定の子プロセス (複数可) を選んで待つことができる。
179 .\"O is not NULL, the
180 .\"O .I struct rusage
181 .\"O to which it points will be filled with accounting information
182 .\"O about the child.
184 .\"O .BR getrusage (2)
191 には子プロセスのアカウント情報が格納される。
195 .\"O .SH "RETURN VALUE"
198 .\"O .BR waitpid (2).
204 .\"O .BR waitpid (2).
207 .\"O .SH "CONFORMING TO"
214 .\"O is not required these days, but increases portability.
216 .\"O .I <sys/resource.h>
219 .\"O structure with fields of type
220 .\"O .I struct timeval
222 .\"O .IR <sys/time.h> .)
225 をインクルードする必要はないが、インクルードしておくと
230 構造体が定義されているが、そのフィールドで使用されている
238 .\"O is a library function implemented on top of the