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 2008-09-28 "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)):
78 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
79 .RB ( feature_test_macros (7)
87 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500
94 .\"O system calls are similar to
96 .\"O but additionally return resource usage information about the
97 .\"O child in the structure pointed to by
105 ¤ÈƱÍͤÎÆ°ºî¤ò¤¹¤ë¡£¤½¤ì¤Ë²Ã¤¨¡¢»Ò¥×¥í¥»¥¹¤Î¥ê¥½¡¼¥¹»ÈÍѾõ¶·¤Î¾ðÊó¤ò
107 ¤¬»Ø¤¹¹½Â¤ÂΤËÆþ¤ì¤ÆÊÖ¤¹¡£
109 .\"O Other than the use of the
111 .\"O argument, the following
116 .\"O wait3(status, options, rusage);
119 .\"O is equivalent to:
122 .\"O waitpid(\-1, status, options);
126 ¤ò»ÈÍѤ¹¤ëÅÀ¤ò½ü¤±¤Ð¡¢°Ê²¼¤Î 2¤Ä¤ÏÅù²Á¤Ç¤¢¤ë¡£
129 wait3(status, options, rusage);
131 waitpid(\-1, status, options);
134 .\"O Similarly, the following
139 .\"O wait4(pid, status, options, rusage);
142 .\"O is equivalent to:
145 .\"O waitpid(pid, status, options);
148 ƱÍͤˡ¢°Ê²¼¤Î 2¤Ä¤âÅù²Á¤Ç¤¢¤ë¡£
151 wait4(pid, status, options, rusage);
153 waitpid(pid, status, options);
158 .\"O waits of any child, while
160 .\"O can be used to select a specific child, or children, on which to wait.
163 .\"O for further details.
166 ¤ÏÁ´¤Æ¤Î»Ò¥×¥í¥»¥¹¤òÂоݤËÂԤĤ¬¡¢
168 ¤Ç¤ÏÆÃÄê¤Î»Ò¥×¥í¥»¥¹ (Ê£¿ô²Ä) ¤òÁª¤ó¤ÇÂԤĤ³¤È¤¬¤Ç¤¤ë¡£
172 .\"O is not NULL, the
173 .\"O .I struct rusage
174 .\"O to which it points will be filled with accounting information
175 .\"O about the child.
177 .\"O .BR getrusage (2)
184 ¤Ë¤Ï»Ò¥×¥í¥»¥¹¤Î¥¢¥«¥¦¥ó¥È¾ðÊ󤬳ÊǼ¤µ¤ì¤ë¡£
188 .\"O .SH "RETURN VALUE"
191 .\"O .BR waitpid (2).
197 .\"O .BR waitpid (2).
200 .\"O .SH "CONFORMING TO"
207 .\"O is not required these days, but increases portability.
209 .\"O .I <sys/resource.h>
212 .\"O structure with fields of type
213 .\"O .I struct timeval
215 .\"O .IR <sys/time.h> .)
218 ¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ëɬÍפϤʤ¤¤¬¡¢¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ¤ª¤¯¤È
219 °Ü¿¢À¤ò¹â¤á¤ë¤³¤È¤¬¤Ç¤¤ë (¼ÂºÝ¤Ë¤Ï
223 ¹½Â¤ÂΤ¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢¤½¤Î¥Õ¥£¡¼¥ë¥É¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë
231 .\"O is a library function implemented on top of the
236 ¤Ï¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ç¤¢¤ê¡¢
238 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£