OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man2 / wait4.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
4 .\" and Copyright (c) 2004 by Michael Kerrisk (mtk.manpages@gmail.com)
5 .\"
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.
9 .\"
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.
14 .\"
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
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" License.
26 .\"
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
33 .\"
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>
42 .\"
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                 ¥¢¥«¥¦¥ó¥È
54 .\"
55 .TH WAIT4 2  2008-09-28 "Linux" "Linux Programmer's Manual"
56 .\"O .SH NAME
57 .SH Ì¾Á°
58 .\"O wait3, wait4 \- wait for process to change state, BSD style
59 wait3, wait4 \- BSD ¥¹¥¿¥¤¥ë¤Ç¥×¥í¥»¥¹¤Î¾õÂÖÊѲ½¤òÂÔ¤Ä
60 .\"O .SH SYNOPSIS
61 .SH ½ñ¼°
62 .nf
63 .B #include <sys/types.h>
64 .B #include <sys/time.h>
65 .B #include <sys/resource.h>
66 .B #include <sys/wait.h>
67 .sp
68 .BI "pid_t wait3(int *" "status" ", int " options ,
69 .BI "            struct rusage *" rusage );
70 .sp
71 .BI "pid_t wait4(pid_t " pid ", int *" status ", int " options ,
72 .BI "            struct rusage *" rusage );
73 .fi
74 .sp
75 .in -4n
76 .\"O Feature Test Macro Requirements for glibc (see
77 .\"O .BR feature_test_macros (7)):
78 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
79 .RB ( feature_test_macros (7)
80 »²¾È):
81 .in
82 .sp
83 .BR wait3 ():
84 _BSD_SOURCE
85 .br
86 .BR wait4 ():
87 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500
88 .\"O .SH DESCRIPTION
89 .SH ÀâÌÀ
90 .\"O The
91 .\"O .BR wait3 ()
92 .\"O and
93 .\"O .BR wait4 ()
94 .\"O system calls are similar to
95 .\"O .BR waitpid (2),
96 .\"O but additionally return resource usage information about the
97 .\"O child in the structure pointed to by
98 .\"O .IR rusage .
99 ¥·¥¹¥Æ¥à¥³¡¼¥ë
100 .BR wait3 ()
101 ¤È
102 .BR wait4 ()
103 ¤Ï
104 .BR waitpid (2)
105 ¤ÈƱÍͤÎÆ°ºî¤ò¤¹¤ë¡£¤½¤ì¤Ë²Ã¤¨¡¢»Ò¥×¥í¥»¥¹¤Î¥ê¥½¡¼¥¹»ÈÍѾõ¶·¤Î¾ðÊó¤ò
106 .I rusage
107 ¤¬»Ø¤¹¹½Â¤ÂΤËÆþ¤ì¤ÆÊÖ¤¹¡£
108 .PP
109 .\"O Other than the use of the
110 .\"O .I rusage
111 .\"O argument, the following
112 .\"O .BR wait3 ()
113 .\"O call:
114 .\"O .nf
115 .\"O
116 .\"O     wait3(status, options, rusage);
117 .\"O
118 .\"O .fi
119 .\"O is equivalent to:
120 .\"O .nf
121 .\"O
122 .\"O     waitpid(\-1, status, options);
123 .\"O
124 .\"O .fi
125 .I rusage
126 ¤ò»ÈÍѤ¹¤ëÅÀ¤ò½ü¤±¤Ð¡¢°Ê²¼¤Î 2¤Ä¤ÏÅù²Á¤Ç¤¢¤ë¡£
127 .nf
128
129     wait3(status, options, rusage);
130
131     waitpid(\-1, status, options);
132
133 .fi
134 .\"O Similarly, the following
135 .\"O .BR wait4 ()
136 .\"O call:
137 .\"O .nf
138 .\"O
139 .\"O     wait4(pid, status, options, rusage);
140 .\"O
141 .\"O .fi
142 .\"O is equivalent to:
143 .\"O .nf
144 .\"O
145 .\"O     waitpid(pid, status, options);
146 .\"O
147 .\"O .fi
148 ƱÍͤˡ¢°Ê²¼¤Î 2¤Ä¤âÅù²Á¤Ç¤¢¤ë¡£
149 .nf
150
151     wait4(pid, status, options, rusage);
152
153     waitpid(pid, status, options);
154
155 .fi
156 .\"O In other words,
157 .\"O .BR wait3 ()
158 .\"O waits of any child, while
159 .\"O .BR wait4 ()
160 .\"O can be used to select a specific child, or children, on which to wait.
161 .\"O See
162 .\"O .BR wait (2)
163 .\"O for further details.
164 ¸À¤¤´¹¤¨¤ë¤È¡¢
165 .BR wait3 ()
166 ¤ÏÁ´¤Æ¤Î»Ò¥×¥í¥»¥¹¤òÂоݤËÂԤĤ¬¡¢
167 .BR wait4 ()
168 ¤Ç¤ÏÆÃÄê¤Î»Ò¥×¥í¥»¥¹ (Ê£¿ô²Ä) ¤òÁª¤ó¤ÇÂԤĤ³¤È¤¬¤Ç¤­¤ë¡£
169 .PP
170 .\"O If
171 .\"O .I rusage
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.
176 .\"O See
177 .\"O .BR getrusage (2)
178 .\"O for details.
179 .I rusage
180 ¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢
181 .I rusage
182 ¤¬»Ø¤¹
183 .I rusage ¹½Â¤ÂÎ
184 ¤Ë¤Ï»Ò¥×¥í¥»¥¹¤Î¥¢¥«¥¦¥ó¥È¾ðÊ󤬳ÊǼ¤µ¤ì¤ë¡£
185 ¾Ü¤·¤¯¤Ï
186 .BR getrusage (2)
187 ¤ò»²¾È¤Î¤³¤È¡£
188 .\"O .SH "RETURN VALUE"
189 .SH ÊÖ¤êÃÍ
190 .\"O As for
191 .\"O .BR waitpid (2).
192 .BR waitpid (2)
193 ¤ÈƱÍÍ¡£
194 .\"O .SH ERRORS
195 .SH ¥¨¥é¡¼
196 .\"O As for
197 .\"O .BR waitpid (2).
198 .BR waitpid (2)
199 ¤ÈƱÍÍ¡£
200 .\"O .SH "CONFORMING TO"
201 .SH ½àµò
202 4.3BSD.
203 .\"O .SH NOTES
204 .SH Ãí°Õ
205 .\"O Including
206 .\"O .I <sys/time.h>
207 .\"O is not required these days, but increases portability.
208 .\"O (Indeed,
209 .\"O .I <sys/resource.h>
210 .\"O defines the
211 .\"O .I rusage
212 .\"O structure with fields of type
213 .\"O .I struct timeval
214 .\"O defined in
215 .\"O .IR <sys/time.h> .)
216 ¸½ºß¤Ç¤Ï
217 .I <sys/time.h>
218 ¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ëɬÍפϤʤ¤¤¬¡¢¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ¤ª¤¯¤È
219 °Ü¿¢À­¤ò¹â¤á¤ë¤³¤È¤¬¤Ç¤­¤ë (¼ÂºÝ¤Ë¤Ï
220 .I <sys/resource.h>
221 ¤Ç
222 .I rusage
223 ¹½Â¤ÂΤ¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢¤½¤Î¥Õ¥£¡¼¥ë¥É¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë
224 .I struct timeval
225 ·¿¤Ï
226 .I <sys/time.h>
227 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë)¡£
228
229 .\"O On Linux,
230 .\"O .BR wait3 ()
231 .\"O is a library function implemented on top of the
232 .\"O .BR wait4 ()
233 .\"O system call.
234 Linux ¤Ç¤Ï¡¢
235 .BR wait3 ()
236 ¤Ï¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ç¤¢¤ê¡¢
237 .BR wait4 ()
238 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£
239 .\"O .SH "SEE ALSO"
240 .SH ´ØÏ¢¹àÌÜ
241 .BR fork (2),
242 .BR getrusage (2),
243 .BR sigaction (2),
244 .BR signal (2),
245 .BR wait (2),
246 .BR signal (7)