Debian Codegraph @

templates/man2/wait.2.pot

raw
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2026-06-05 06:50+0200\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <[email protected]>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #. type: TH
20 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
21 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
22 #, no-wrap
23 msgid "wait"
24 msgstr ""
25
26 #. type: TH
27 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
28 #: opensuse-tumbleweed
29 #, no-wrap
30 msgid "2026-02-08"
31 msgstr ""
32
33 #. type: TH
34 #: archlinux debian-unstable
35 #, no-wrap
36 msgid "Linux man-pages 6.18"
37 msgstr ""
38
39 #. type: SH
40 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
41 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
42 #, no-wrap
43 msgid "NAME"
44 msgstr ""
45
46 #. type: Plain text
47 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
48 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
49 msgid "wait, waitpid, waitid - wait for process to change state"
50 msgstr ""
51
52 #. type: SH
53 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
54 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
55 #, no-wrap
56 msgid "LIBRARY"
57 msgstr ""
58
59 #. type: Plain text
60 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
61 #: opensuse-leap-16-1 opensuse-tumbleweed
62 msgid "Standard C library (I<libc>,\\ I<-lc>)"
63 msgstr ""
64
65 #. type: SH
66 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
67 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
68 #, no-wrap
69 msgid "SYNOPSIS"
70 msgstr ""
71
72 #. type: Plain text
73 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
74 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
75 #, no-wrap
76 msgid "B<#include E<lt>sys/wait.hE<gt>>\n"
77 msgstr ""
78
79 #. type: Plain text
80 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
81 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
82 #, no-wrap
83 msgid ""
84 "B<pid_t wait(int *_Nullable >I<wstatus>B<);>\n"
85 "B<pid_t waitpid(pid_t >I<pid>B<, int *_Nullable >I<wstatus>B<, int >I<options>B<);>\n"
86 msgstr ""
87
88 #. type: Plain text
89 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
90 #: opensuse-tumbleweed
91 #, no-wrap
92 msgid ""
93 "B<int waitid(idtype_t >I<idtype>B<, id_t >I<id>B<, siginfo_t *>I<infop>B<, int >I<options>B<);>\n"
94 " /* This is the glibc and POSIX interface; see\n"
95 " VERSIONS for information on the raw system call. */\n"
96 msgstr ""
97
98 #. type: Plain text
99 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
100 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
101 msgid ""
102 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
103 msgstr ""
104
105 #. type: Plain text
106 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
107 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
108 msgid "B<waitid>():"
109 msgstr ""
110
111 #. (_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED)
112 #. type: Plain text
113 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
114 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
115 #, no-wrap
116 msgid ""
117 " Since glibc 2.26:\n"
118 " _XOPEN_SOURCE E<gt>= 500 || _POSIX_C_SOURCE E<gt>= 200809L\n"
119 " glibc 2.25 and earlier:\n"
120 " _XOPEN_SOURCE\n"
121 " || /* Since glibc 2.12: */ _POSIX_C_SOURCE E<gt>= 200809L\n"
122 " || /* glibc E<lt>= 2.19: */ _BSD_SOURCE\n"
123 msgstr ""
124
125 #. type: SH
126 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
127 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
128 #, no-wrap
129 msgid "DESCRIPTION"
130 msgstr ""
131
132 #. type: Plain text
133 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
134 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
135 msgid ""
136 "All of these system calls are used to wait for state changes in a child of "
137 "the calling process, and obtain information about the child whose state has "
138 "changed. A state change is considered to be: the child terminated; the "
139 "child was stopped by a signal; or the child was resumed by a signal. In the "
140 "case of a terminated child, performing a wait allows the system to release "
141 "the resources associated with the child; if a wait is not performed, then "
142 "the terminated child remains in a \"zombie\" state (see NOTES below)."
143 msgstr ""
144
145 #. type: Plain text
146 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
147 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
148 msgid ""
149 "If a child has already changed state, then these calls return immediately. "
150 "Otherwise, they block until either a child changes state or a signal handler "
151 "interrupts the call (assuming that system calls are not automatically "
152 "restarted using the B<SA_RESTART> flag of B<sigaction>(2)). In the "
153 "remainder of this page, a child whose state has changed and which has not "
154 "yet been waited upon by one of these system calls is termed I<waitable>."
155 msgstr ""
156
157 #. type: SS
158 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
159 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
160 #, no-wrap
161 msgid "wait() and waitpid()"
162 msgstr ""
163
164 #. type: Plain text
165 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
166 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
167 msgid ""
168 "The B<wait>() system call suspends execution of the calling thread until "
169 "one of its children terminates. The call I<wait(&wstatus)> is equivalent to:"
170 msgstr ""
171
172 #. type: Plain text
173 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
174 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
175 #, no-wrap
176 msgid "waitpid(-1, &wstatus, 0);\n"
177 msgstr ""
178
179 #. type: Plain text
180 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
181 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
182 msgid ""
183 "The B<waitpid>() system call suspends execution of the calling thread until "
184 "a child specified by I<pid> argument has changed state. By default, "
185 "B<waitpid>() waits only for terminated children, but this behavior is "
186 "modifiable via the I<options> argument, as described below."
187 msgstr ""
188
189 #. type: Plain text
190 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
191 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
192 msgid "The value of I<pid> can be:"
193 msgstr ""
194
195 #. type: TP
196 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
197 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
198 #, no-wrap
199 msgid "E<lt> B<-1>"
200 msgstr ""
201
202 #. type: Plain text
203 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
204 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
205 msgid ""
206 "meaning wait for any child process whose process group ID is equal to the "
207 "absolute value of I<pid>."
208 msgstr ""
209
210 #. type: TP
211 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
212 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
213 #, no-wrap
214 msgid "B<-1>"
215 msgstr ""
216
217 #. type: Plain text
218 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
219 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
220 msgid "meaning wait for any child process."
221 msgstr ""
222
223 #. type: TP
224 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
225 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
226 #, no-wrap
227 msgid "B<0>"
228 msgstr ""
229
230 #. type: Plain text
231 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
232 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
233 msgid ""
234 "meaning wait for any child process whose process group ID is equal to that "
235 "of the calling process at the time of the call to B<waitpid>()."
236 msgstr ""
237
238 #. type: TP
239 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
240 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
241 #, no-wrap
242 msgid "E<gt> B<0>"
243 msgstr ""
244
245 #. type: Plain text
246 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
247 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
248 msgid ""
249 "meaning wait for the child whose process ID is equal to the value of I<pid>."
250 msgstr ""
251
252 #. type: Plain text
253 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
254 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
255 msgid ""
256 "The value of I<options> is an OR of zero or more of the following constants:"
257 msgstr ""
258
259 #. type: TP
260 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
261 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
262 #, no-wrap
263 msgid "B<WNOHANG>"
264 msgstr ""
265
266 #. type: Plain text
267 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
268 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
269 msgid "return immediately if no child has exited."
270 msgstr ""
271
272 #. type: TP
273 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
274 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
275 #, no-wrap
276 msgid "B<WUNTRACED>"
277 msgstr ""
278
279 #. type: Plain text
280 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
281 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
282 msgid ""
283 "also return if a child has stopped (but not traced via B<ptrace>(2)). "
284 "Status for I<traced> children which have stopped is provided even if this "
285 "option is not specified."
286 msgstr ""
287
288 #. type: TP
289 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
290 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
291 #, no-wrap
292 msgid "B<WCONTINUED> (since Linux 2.6.10)"
293 msgstr ""
294
295 #. type: Plain text
296 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
297 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
298 msgid ""
299 "also return if a stopped child has been resumed by delivery of B<SIGCONT>."
300 msgstr ""
301
302 #. type: Plain text
303 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
304 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
305 msgid "(For Linux-only options, see below.)"
306 msgstr ""
307
308 #. type: Plain text
309 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
310 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
311 msgid ""
312 "If I<wstatus> is not NULL, B<wait>() and B<waitpid>() store status "
313 "information in the I<int> to which it points. This integer can be inspected "
314 "with the following macros (which take the integer itself as an argument, not "
315 "a pointer to it, as is done in B<wait>() and B<waitpid>()!):"
316 msgstr ""
317
318 #. type: TP
319 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
320 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
321 #, no-wrap
322 msgid "B<WIFEXITED(>I<wstatus>B<)>"
323 msgstr ""
324
325 #. type: Plain text
326 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
327 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
328 msgid ""
329 "returns true if the child terminated normally, that is, by calling "
330 "B<exit>(3) or B<_exit>(2), or by returning from main()."
331 msgstr ""
332
333 #. type: TP
334 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
335 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
336 #, no-wrap
337 msgid "B<WEXITSTATUS(>I<wstatus>B<)>"
338 msgstr ""
339
340 #. type: Plain text
341 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
342 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
343 msgid ""
344 "returns the exit status of the child. This consists of the least "
345 "significant 8 bits of the I<status> argument that the child specified in a "
346 "call to B<exit>(3) or B<_exit>(2) or as the argument for a return "
347 "statement in main(). This macro should be employed only if B<WIFEXITED> "
348 "returned true."
349 msgstr ""
350
351 #. type: TP
352 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
353 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
354 #, no-wrap
355 msgid "B<WIFSIGNALED(>I<wstatus>B<)>"
356 msgstr ""
357
358 #. type: Plain text
359 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
360 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
361 msgid "returns true if the child process was terminated by a signal."
362 msgstr ""
363
364 #. type: TP
365 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
366 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
367 #, no-wrap
368 msgid "B<WTERMSIG(>I<wstatus>B<)>"
369 msgstr ""
370
371 #. type: Plain text
372 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
373 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
374 msgid ""
375 "returns the number of the signal that caused the child process to "
376 "terminate. This macro should be employed only if B<WIFSIGNALED> returned "
377 "true."
378 msgstr ""
379
380 #. type: TP
381 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
382 #: opensuse-tumbleweed
383 #, no-wrap
384 msgid "B<WCOREDUMP(>I<wstatus>B<)>I< >\\f[R]// POSIX.1-2024\\fR"
385 msgstr ""
386
387 #. type: Plain text
388 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
389 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
390 msgid ""
391 "returns true if the child produced a core dump (see B<core>(5)). This macro "
392 "should be employed only if B<WIFSIGNALED> returned true."
393 msgstr ""
394
395 #. type: TP
396 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
397 #: opensuse-tumbleweed
398 #, no-wrap
399 msgid "B<WIFSTOPPED(>I<wstatus>B<)>I< >\\f[R]// POSIX.1-2024\\fR"
400 msgstr ""
401
402 #. type: Plain text
403 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
404 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
405 msgid ""
406 "returns true if the child process was stopped by delivery of a signal; this "
407 "is possible only if the call was done using B<WUNTRACED> or when the child "
408 "is being traced (see B<ptrace>(2))."
409 msgstr ""
410
411 #. type: TP
412 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
413 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
414 #, no-wrap
415 msgid "B<WSTOPSIG(>I<wstatus>B<)>"
416 msgstr ""
417
418 #. type: Plain text
419 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
420 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
421 msgid ""
422 "returns the number of the signal which caused the child to stop. This macro "
423 "should be employed only if B<WIFSTOPPED> returned true."
424 msgstr ""
425
426 #. type: TP
427 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
428 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
429 #, no-wrap
430 msgid "B<WIFCONTINUED(>I<wstatus>B<)>"
431 msgstr ""
432
433 #. type: Plain text
434 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
435 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
436 msgid ""
437 "(since Linux 2.6.10) returns true if the child process was resumed by "
438 "delivery of B<SIGCONT>."
439 msgstr ""
440
441 #. type: SS
442 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
443 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
444 #, no-wrap
445 msgid "waitid()"
446 msgstr ""
447
448 #. type: Plain text
449 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
450 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
451 msgid ""
452 "The B<waitid>() system call (available since Linux 2.6.9) provides more "
453 "precise control over which child state changes to wait for."
454 msgstr ""
455
456 #. type: Plain text
457 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
458 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
459 msgid ""
460 "The I<idtype> and I<id> arguments select the child(ren) to wait for, as "
461 "follows:"
462 msgstr ""
463
464 #. type: TP
465 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
466 #: opensuse-tumbleweed
467 #, no-wrap
468 msgid "I<idtype> == \\f[B]P_PID\\fR"
469 msgstr ""
470
471 #. type: Plain text
472 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
473 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
474 msgid "Wait for the child whose process ID matches I<id>."
475 msgstr ""
476
477 #. type: TP
478 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
479 #: opensuse-tumbleweed
480 #, no-wrap
481 msgid "I<idtype> == \\f[B]P_PIDFD\\fR (since Linux 5.4)"
482 msgstr ""
483
484 #. commit 3695eae5fee0605f316fbaad0b9e3de791d7dfaf
485 #. type: Plain text
486 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
487 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
488 msgid ""
489 "Wait for the child referred to by the PID file descriptor specified in "
490 "I<id>. (See B<pidfd_open>(2) for further information on PID file "
491 "descriptors.)"
492 msgstr ""
493
494 #. type: TP
495 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
496 #: opensuse-tumbleweed
497 #, no-wrap
498 msgid "I<idtype> == \\f[B]P_PGID\\fR"
499 msgstr ""
500
501 #. commit 821cc7b0b205c0df64cce59aacc330af251fa8f7
502 #. type: Plain text
503 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
504 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
505 msgid ""
506 "Wait for any child whose process group ID matches I<id>. Since Linux 5.4, "
507 "if I<id> is zero, then wait for any child that is in the same process group "
508 "as the caller's process group at the time of the call."
509 msgstr ""
510
511 #. type: TP
512 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
513 #: opensuse-tumbleweed
514 #, no-wrap
515 msgid "I<idtype> == \\f[B]P_ALL\\fR"
516 msgstr ""
517
518 #. type: Plain text
519 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
520 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
521 msgid "Wait for any child; I<id> is ignored."
522 msgstr ""
523
524 #. type: Plain text
525 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
526 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
527 msgid ""
528 "The child state changes to wait for are specified by ORing one or more of "
529 "the following flags in I<options>:"
530 msgstr ""
531
532 #. type: TP
533 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
534 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
535 #, no-wrap
536 msgid "B<WEXITED>"
537 msgstr ""
538
539 #. type: Plain text
540 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
541 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
542 msgid "Wait for children that have terminated."
543 msgstr ""
544
545 #. type: TP
546 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
547 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
548 #, no-wrap
549 msgid "B<WSTOPPED>"
550 msgstr ""
551
552 #. type: Plain text
553 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
554 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
555 msgid "Wait for children that have been stopped by delivery of a signal."
556 msgstr ""
557
558 #. type: TP
559 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
560 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
561 #, no-wrap
562 msgid "B<WCONTINUED>"
563 msgstr ""
564
565 #. type: Plain text
566 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
567 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
568 msgid ""
569 "Wait for (previously stopped) children that have been resumed by delivery of "
570 "B<SIGCONT>."
571 msgstr ""
572
573 #. type: Plain text
574 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
575 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
576 msgid "The following flags may additionally be ORed in I<options>:"
577 msgstr ""
578
579 #. type: Plain text
580 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
581 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
582 msgid "As for B<waitpid>()."
583 msgstr ""
584
585 #. type: TP
586 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
587 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
588 #, no-wrap
589 msgid "B<WNOWAIT>"
590 msgstr ""
591
592 #. type: Plain text
593 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
594 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
595 msgid ""
596 "Leave the child in a waitable state; a later wait call can be used to again "
597 "retrieve the child status information."
598 msgstr ""
599
600 #. type: Plain text
601 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
602 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
603 msgid ""
604 "Upon successful return, B<waitid>() fills in the following fields of the "
605 "I<siginfo_t> structure pointed to by I<infop>:"
606 msgstr ""
607
608 #. type: TP
609 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
610 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
611 #, no-wrap
612 msgid "I<si_pid>"
613 msgstr ""
614
615 #. type: Plain text
616 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
617 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
618 msgid "The process ID of the child."
619 msgstr ""
620
621 #. type: TP
622 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
623 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
624 #, no-wrap
625 msgid "I<si_uid>"
626 msgstr ""
627
628 #. type: Plain text
629 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
630 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
631 msgid ""
632 "The real user ID of the child. (This field is not set on most other "
633 "implementations.)"
634 msgstr ""
635
636 #. type: TP
637 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
638 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
639 #, no-wrap
640 msgid "I<si_signo>"
641 msgstr ""
642
643 #. type: Plain text
644 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
645 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
646 msgid "Always set to B<SIGCHLD>."
647 msgstr ""
648
649 #. type: TP
650 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
651 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
652 #, no-wrap
653 msgid "I<si_status>"
654 msgstr ""
655
656 #. type: Plain text
657 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
658 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
659 msgid ""
660 "Either the exit status of the child, as given to B<_exit>(2) (or "
661 "B<exit>(3)), or the signal that caused the child to terminate, stop, or "
662 "continue. The I<si_code> field can be used to determine how to interpret "
663 "this field."
664 msgstr ""
665
666 #. type: TP
667 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
668 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
669 #, no-wrap
670 msgid "I<si_code>"
671 msgstr ""
672
673 #. type: Plain text
674 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
675 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
676 msgid ""
677 "Set to one of: B<CLD_EXITED> (child called B<_exit>(2)); B<CLD_KILLED> "
678 "(child killed by signal); B<CLD_DUMPED> (child killed by signal, and dumped "
679 "core); B<CLD_STOPPED> (child stopped by signal); B<CLD_TRAPPED> (traced "
680 "child has trapped); or B<CLD_CONTINUED> (child continued by B<SIGCONT>)."
681 msgstr ""
682
683 #. type: Plain text
684 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
685 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
686 msgid ""
687 "If B<WNOHANG> was specified in I<options> and there were no children in a "
688 "waitable state, then B<waitid>() returns 0 immediately and the state of the "
689 "I<siginfo_t> structure pointed to by I<infop> depends on the "
690 "implementation. To (portably) distinguish this case from that where a child "
691 "was in a waitable state, zero out the I<si_pid> field before the call and "
692 "check for a nonzero value in this field after the call returns."
693 msgstr ""
694
695 #. POSIX.1-2001 leaves this possibility unspecified; most
696 #. implementations (including Linux) zero out the structure
697 #. in this case, but at least one implementation (AIX 5.1)
698 #. does not -- MTK Nov 04
699 #. type: Plain text
700 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
701 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
702 msgid ""
703 "POSIX.1-2008 Technical Corrigendum 1 (2013) adds the requirement that when "
704 "B<WNOHANG> is specified in I<options> and there were no children in a "
705 "waitable state, then B<waitid>() should zero out the I<si_pid> and "
706 "I<si_signo> fields of the structure. On Linux and other implementations "
707 "that adhere to this requirement, it is not necessary to zero out the "
708 "I<si_pid> field before calling B<waitid>(). However, not all "
709 "implementations follow the POSIX.1 specification on this point."
710 msgstr ""
711
712 #. type: SH
713 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
714 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
715 #, no-wrap
716 msgid "RETURN VALUE"
717 msgstr ""
718
719 #. type: Plain text
720 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
721 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
722 msgid ""
723 "B<wait>(): on success, returns the process ID of the terminated child; on "
724 "failure, -1 is returned."
725 msgstr ""
726
727 #. type: Plain text
728 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
729 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
730 msgid ""
731 "B<waitpid>(): on success, returns the process ID of the child whose state "
732 "has changed; if B<WNOHANG> was specified and one or more child(ren) "
733 "specified by I<pid> exist, but have not yet changed state, then 0 is "
734 "returned. On failure, -1 is returned."
735 msgstr ""
736
737 #. FIXME As reported by Vegard Nossum, if infop is NULL, then waitid()
738 #. returns the PID of the child. Either this is a bug, or it is intended
739 #. behavior that needs to be documented. See my Jan 2009 LKML mail
740 #. "waitid() return value strangeness when infop is NULL".
741 #. type: Plain text
742 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
743 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
744 msgid ""
745 "B<waitid>(): returns 0 on success or if B<WNOHANG> was specified and no "
746 "child(ren) specified by I<id> has yet changed state; on failure, -1 is "
747 "returned."
748 msgstr ""
749
750 #. type: Plain text
751 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
752 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
753 msgid "On failure, each of these calls sets I<errno> to indicate the error."
754 msgstr ""
755
756 #. type: SH
757 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
758 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
759 #, no-wrap
760 msgid "ERRORS"
761 msgstr ""
762
763 #. type: TP
764 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
765 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
766 #, no-wrap
767 msgid "B<EAGAIN>"
768 msgstr ""
769
770 #. type: Plain text
771 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
772 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
773 msgid ""
774 "The PID file descriptor specified in I<id> is nonblocking and the process "
775 "that it refers to has not terminated."
776 msgstr ""
777
778 #. type: TP
779 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
780 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
781 #, no-wrap
782 msgid "B<ECHILD>"
783 msgstr ""
784
785 #. type: Plain text
786 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
787 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
788 msgid ""
789 "(for B<wait>()) The calling process does not have any unwaited-for children."
790 msgstr ""
791
792 #. type: Plain text
793 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
794 #: opensuse-tumbleweed
795 msgid ""
796 "(for B<waitpid>() or B<waitid>()) The process specified by I<pid> "
797 "(B<waitpid>()) or I<idtype> and I<id> (B<waitid>()) does not exist or is "
798 "not a child of the calling process. (This can happen for one's own child if "
799 "the action for B<SIGCHLD> is set to B<SIG_IGN>. See also the I<Linux\\ "
800 "Notes> section about threads.)"
801 msgstr ""
802
803 #. type: TP
804 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
805 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
806 #, no-wrap
807 msgid "B<EINTR>"
808 msgstr ""
809
810 #. type: Plain text
811 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
812 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
813 msgid ""
814 "B<WNOHANG> was not set and an unblocked signal or a B<SIGCHLD> was caught; "
815 "see B<signal>(7)."
816 msgstr ""
817
818 #. type: TP
819 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
820 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
821 #, no-wrap
822 msgid "B<EINVAL>"
823 msgstr ""
824
825 #. type: Plain text
826 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
827 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
828 msgid "The I<options> argument was invalid."
829 msgstr ""
830
831 #. type: TP
832 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
833 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
834 #, no-wrap
835 msgid "B<ESRCH>"
836 msgstr ""
837
838 #. type: Plain text
839 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
840 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
841 msgid "(for B<wait>() or B<waitpid>()) I<pid> is equal to B<INT_MIN>."
842 msgstr ""
843
844 #. type: SH
845 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
846 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
847 #, no-wrap
848 msgid "VERSIONS"
849 msgstr ""
850
851 #. type: SS
852 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
853 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
854 #, no-wrap
855 msgid "C library/kernel differences"
856 msgstr ""
857
858 #. type: Plain text
859 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
860 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
861 msgid ""
862 "B<wait>() is actually a library function that (in glibc) is implemented as "
863 "a call to B<wait4>(2)."
864 msgstr ""
865
866 #. e.g., i386 has the system call, but not x86-64
867 #. type: Plain text
868 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
869 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
870 msgid ""
871 "On some architectures, there is no B<waitpid>() system call; instead, this "
872 "interface is implemented via a C library wrapper function that calls "
873 "B<wait4>(2)."
874 msgstr ""
875
876 #. type: Plain text
877 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
878 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
879 msgid ""
880 "The raw B<waitid>() system call takes a fifth argument, of type I<struct "
881 "rusage\\ *>. If this argument is non-NULL, then it is used to return "
882 "resource usage information about the child, in the same manner as "
883 "B<wait4>(2). See B<getrusage>(2) for details."
884 msgstr ""
885
886 #. type: SH
887 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
888 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
889 #, no-wrap
890 msgid "STANDARDS"
891 msgstr ""
892
893 #. type: Plain text
894 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
895 #: opensuse-tumbleweed
896 msgid "POSIX.1-2024."
897 msgstr ""
898
899 #. type: SH
900 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
901 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
902 #, no-wrap
903 msgid "HISTORY"
904 msgstr ""
905
906 #. type: Plain text
907 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
908 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
909 msgid "SVr4, 4.3BSD, POSIX.1-2001."
910 msgstr ""
911
912 #. type: SH
913 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
914 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
915 #, no-wrap
916 msgid "NOTES"
917 msgstr ""
918
919 #. type: Plain text
920 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
921 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
922 msgid ""
923 "A child that terminates, but has not been waited for becomes a \"zombie\". "
924 "The kernel maintains a minimal set of information about the zombie process "
925 "(PID, termination status, resource usage information) in order to allow the "
926 "parent to later perform a wait to obtain information about the child. As "
927 "long as a zombie is not removed from the system via a wait, it will consume "
928 "a slot in the kernel process table, and if this table fills, it will not be "
929 "possible to create further processes. If a parent process terminates, then "
930 "its \"zombie\" children (if any) are adopted by B<init>(1), (or by the "
931 "nearest \"subreaper\" process as defined through the use of the B<prctl>(2) "
932 "B<PR_SET_CHILD_SUBREAPER> operation); B<init>(1) automatically performs a "
933 "wait to remove the zombies."
934 msgstr ""
935
936 #. type: Plain text
937 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
938 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
939 msgid ""
940 "POSIX.1-2001 specifies that if the disposition of B<SIGCHLD> is set to "
941 "B<SIG_IGN> or the B<SA_NOCLDWAIT> flag is set for B<SIGCHLD> (see "
942 "B<sigaction>(2)), then children that terminate do not become zombies and a "
943 "call to B<wait>() or B<waitpid>() will block until all children have "
944 "terminated, and then fail with I<errno> set to B<ECHILD>. (The original "
945 "POSIX standard left the behavior of setting B<SIGCHLD> to B<SIG_IGN> "
946 "unspecified. Note that even though the default disposition of B<SIGCHLD> is "
947 "\"ignore\", explicitly setting the disposition to B<SIG_IGN> results in "
948 "different treatment of zombie process children.)"
949 msgstr ""
950
951 #. type: Plain text
952 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
953 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
954 msgid ""
955 "Linux 2.6 conforms to the POSIX requirements. However, Linux 2.4 (and "
956 "earlier) does not: if a B<wait>() or B<waitpid>() call is made while "
957 "B<SIGCHLD> is being ignored, the call behaves just as though B<SIGCHLD> were "
958 "not being ignored, that is, the call blocks until the next child terminates "
959 "and then returns the process ID and status of that child."
960 msgstr ""
961
962 #. type: SS
963 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
964 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
965 #, no-wrap
966 msgid "Linux notes"
967 msgstr ""
968
969 #. type: Plain text
970 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
971 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
972 msgid ""
973 "In the Linux kernel, a kernel-scheduled thread is not a distinct construct "
974 "from a process. Instead, a thread is simply a process that is created using "
975 "the Linux-unique B<clone>(2) system call; other routines such as the "
976 "portable B<pthread_create>(3) call are implemented using B<clone>(2). "
977 "Before Linux 2.4, a thread was just a special case of a process, and as a "
978 "consequence one thread could not wait on the children of another thread, "
979 "even when the latter belongs to the same thread group. However, POSIX "
980 "prescribes such functionality, and since Linux 2.4 a thread can, and by "
981 "default will, wait on children of other threads in the same thread group."
982 msgstr ""
983
984 #. commit 91c4e8ea8f05916df0c8a6f383508ac7c9e10dba
985 #. type: Plain text
986 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
987 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
988 msgid ""
989 "The following Linux-specific I<options> are for use with children created "
990 "using B<clone>(2); they can also, since Linux 4.7, be used with B<waitid>():"
991 msgstr ""
992
993 #. type: TP
994 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
995 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
996 #, no-wrap
997 msgid "B<__WCLONE>"
998 msgstr ""
999
1000 #. since 0.99pl10
1001 #. type: Plain text
1002 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1003 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1004 msgid ""
1005 "Wait for \"clone\" children only. If omitted, then wait for \"non-clone\" "
1006 "children only. (A \"clone\" child is one which delivers no signal, or a "
1007 "signal other than B<SIGCHLD> to its parent upon termination.) This option "
1008 "is ignored if B<__WALL> is also specified."
1009 msgstr ""
1010
1011 #. type: TP
1012 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1013 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1014 #, no-wrap
1015 msgid "B<__WALL> (since Linux 2.4)"
1016 msgstr ""
1017
1018 #. since patch-2.3.48
1019 #. type: Plain text
1020 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1021 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1022 msgid "Wait for all children, regardless of type (\"clone\" or \"non-clone\")."
1023 msgstr ""
1024
1025 #. type: TP
1026 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1027 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1028 #, no-wrap
1029 msgid "B<__WNOTHREAD> (since Linux 2.4)"
1030 msgstr ""
1031
1032 #. since patch-2.4.0-test8
1033 #. type: Plain text
1034 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1035 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1036 msgid ""
1037 "Do not wait for children of other threads in the same thread group. This "
1038 "was the default before Linux 2.4."
1039 msgstr ""
1040
1041 #. commit bf959931ddb88c4e4366e96dd22e68fa0db9527c
1042 #. prevents cases where an unreapable zombie is created if
1043 #. /sbin/init doesn't use __WALL.
1044 #. type: Plain text
1045 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1046 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1047 msgid ""
1048 "Since Linux 4.7, the B<__WALL> flag is automatically implied if the child is "
1049 "being ptraced."
1050 msgstr ""
1051
1052 #. type: SH
1053 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1054 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1055 #, no-wrap
1056 msgid "BUGS"
1057 msgstr ""
1058
1059 #. type: Plain text
1060 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1061 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1062 msgid ""
1063 "According to POSIX.1-2008, an application calling B<waitid>() must ensure "
1064 "that I<infop> points to a I<siginfo_t> structure (i.e., that it is a non-"
1065 "null pointer). On Linux, if I<infop> is NULL, B<waitid>() succeeds, and "
1066 "returns the process ID of the waited-for child. Applications should avoid "
1067 "relying on this inconsistent, nonstandard, and unnecessary feature."
1068 msgstr ""
1069
1070 #. type: SH
1071 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1072 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1073 #, no-wrap
1074 msgid "EXAMPLES"
1075 msgstr ""
1076
1077 #. fork.2 refers to this example program.
1078 #. type: Plain text
1079 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1080 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1081 msgid ""
1082 "The following program demonstrates the use of B<fork>(2) and B<waitpid>(). "
1083 "The program creates a child process. If no command-line argument is "
1084 "supplied to the program, then the child suspends its execution using "
1085 "B<pause>(2), to allow the user to send signals to the child. Otherwise, if "
1086 "a command-line argument is supplied, then the child exits immediately, using "
1087 "the integer supplied on the command line as the exit status. The parent "
1088 "process executes a loop that monitors the child using B<waitpid>(), and uses "
1089 "the W*() macros described above to analyze the wait status value."
1090 msgstr ""
1091
1092 #. type: Plain text
1093 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1094 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1095 msgid "The following shell session demonstrates the use of the program:"
1096 msgstr ""
1097
1098 #. type: Plain text
1099 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1100 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1101 #, no-wrap
1102 msgid ""
1103 "$B< ./a.out &>\n"
1104 "Child PID is 32360\n"
1105 "[1] 32359\n"
1106 "$B< kill -STOP 32360>\n"
1107 "stopped by signal 19\n"
1108 "$B< kill -CONT 32360>\n"
1109 "continued\n"
1110 "$B< kill -TERM 32360>\n"
1111 "killed by signal 15\n"
1112 "[1]+ Done ./a.out\n"
1113 "$\n"
1114 msgstr ""
1115
1116 #. type: SS
1117 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1118 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1119 #, no-wrap
1120 msgid "Program source"
1121 msgstr ""
1122
1123 #. type: Plain text
1124 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1125 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1126 #, no-wrap
1127 msgid ""
1128 "#include E<lt>stdint.hE<gt>\n"
1129 "#include E<lt>stdio.hE<gt>\n"
1130 "#include E<lt>stdlib.hE<gt>\n"
1131 "#include E<lt>sys/types.hE<gt>\n"
1132 "#include E<lt>sys/wait.hE<gt>\n"
1133 "#include E<lt>unistd.hE<gt>\n"
1134 "\\&\n"
1135 "int\n"
1136 "main(int argc, char *argv[])\n"
1137 "{\n"
1138 " int wstatus;\n"
1139 " pid_t cpid, w;\n"
1140 "\\&\n"
1141 " cpid = fork();\n"
1142 " if (cpid == -1) {\n"
1143 " perror(\"fork\");\n"
1144 " exit(EXIT_FAILURE);\n"
1145 " }\n"
1146 "\\&\n"
1147 " if (cpid == 0) { /* Code executed by child */\n"
1148 " printf(\"Child PID is %jd\\[rs]n\", (intmax_t) getpid());\n"
1149 " if (argc == 1)\n"
1150 " pause(); /* Wait for signals */\n"
1151 " _exit(atoi(argv[1]));\n"
1152 "\\&\n"
1153 " } else { /* Code executed by parent */\n"
1154 " do {\n"
1155 " w = waitpid(cpid, &wstatus, WUNTRACED | WCONTINUED);\n"
1156 " if (w == -1) {\n"
1157 " perror(\"waitpid\");\n"
1158 " exit(EXIT_FAILURE);\n"
1159 " }\n"
1160 "\\&\n"
1161 " if (WIFEXITED(wstatus)) {\n"
1162 " printf(\"exited, status=%d\\[rs]n\", WEXITSTATUS(wstatus));\n"
1163 " } else if (WIFSIGNALED(wstatus)) {\n"
1164 " printf(\"killed by signal %d\\[rs]n\", WTERMSIG(wstatus));\n"
1165 " } else if (WIFSTOPPED(wstatus)) {\n"
1166 " printf(\"stopped by signal %d\\[rs]n\", WSTOPSIG(wstatus));\n"
1167 " } else if (WIFCONTINUED(wstatus)) {\n"
1168 " printf(\"continued\\[rs]n\");\n"
1169 " }\n"
1170 " } while (!WIFEXITED(wstatus) && !WIFSIGNALED(wstatus));\n"
1171 " exit(EXIT_SUCCESS);\n"
1172 " }\n"
1173 "}\n"
1174 msgstr ""
1175
1176 #. SRC END
1177 #. type: SH
1178 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1179 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1180 #, no-wrap
1181 msgid "SEE ALSO"
1182 msgstr ""
1183
1184 #. type: Plain text
1185 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1186 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1187 msgid ""
1188 "B<_exit>(2), B<clone>(2), B<fork>(2), B<kill>(2), B<ptrace>(2), "
1189 "B<sigaction>(2), B<signal>(2), B<wait4>(2), B<pthread_create>(3), "
1190 "B<core>(5), B<credentials>(7), B<signal>(7)"
1191 msgstr ""
1192
1193 #. type: TH
1194 #: debian-trixie
1195 #, no-wrap
1196 msgid "2024-06-15"
1197 msgstr ""
1198
1199 #. type: TH
1200 #: debian-trixie
1201 #, no-wrap
1202 msgid "Linux man-pages 6.9.1"
1203 msgstr ""
1204
1205 #. type: Plain text
1206 #: debian-trixie
1207 msgid "Standard C library (I<libc>, I<-lc>)"
1208 msgstr ""
1209
1210 #. type: Plain text
1211 #: debian-trixie
1212 #, no-wrap
1213 msgid ""
1214 "B<int waitid(idtype_t >I<idtype>B<, id_t >I<id>B<, siginfo_t *>I<infop>B<, int >I<options>B<);>\n"
1215 " /* This is the glibc and POSIX interface; see\n"
1216 " NOTES for information on the raw system call. */\n"
1217 msgstr ""
1218
1219 #. type: TP
1220 #: debian-trixie fedora-44 fedora-rawhide
1221 #, no-wrap
1222 msgid "B<WCOREDUMP(>I<wstatus>B<)>"
1223 msgstr ""
1224
1225 #. type: Plain text
1226 #: debian-trixie fedora-44 fedora-rawhide
1227 msgid ""
1228 "This macro is not specified in POSIX.1-2001 and is not available on some "
1229 "UNIX implementations (e.g., AIX, SunOS). Therefore, enclose its use inside "
1230 "I<#ifdef WCOREDUMP ... #endif>."
1231 msgstr ""
1232
1233 #. type: TP
1234 #: debian-trixie fedora-44 fedora-rawhide
1235 #, no-wrap
1236 msgid "B<WIFSTOPPED(>I<wstatus>B<)>"
1237 msgstr ""
1238
1239 #. type: TP
1240 #: debian-trixie fedora-44 fedora-rawhide
1241 #, no-wrap
1242 msgid "I<idtype> == B<P_PID>"
1243 msgstr ""
1244
1245 #. type: TP
1246 #: debian-trixie fedora-44 fedora-rawhide
1247 #, no-wrap
1248 msgid "I<idtype> == B<P_PIDFD> (since Linux 5.4)"
1249 msgstr ""
1250
1251 #. type: TP
1252 #: debian-trixie fedora-44 fedora-rawhide
1253 #, no-wrap
1254 msgid "I<idtype> == B<P_PGID>"
1255 msgstr ""
1256
1257 #. type: TP
1258 #: debian-trixie fedora-44 fedora-rawhide
1259 #, no-wrap
1260 msgid "I<idtype> == B<P_ALL>"
1261 msgstr ""
1262
1263 #. type: Plain text
1264 #: debian-trixie fedora-44 fedora-rawhide
1265 msgid ""
1266 "(for B<waitpid>() or B<waitid>()) The process specified by I<pid> "
1267 "(B<waitpid>()) or I<idtype> and I<id> (B<waitid>()) does not exist or is "
1268 "not a child of the calling process. (This can happen for one's own child if "
1269 "the action for B<SIGCHLD> is set to B<SIG_IGN>. See also the I<Linux Notes> "
1270 "section about threads.)"
1271 msgstr ""
1272
1273 #. type: Plain text
1274 #: debian-trixie fedora-44 fedora-rawhide
1275 msgid "POSIX.1-2008."
1276 msgstr ""
1277
1278 #. type: TH
1279 #: fedora-44 fedora-rawhide
1280 #, no-wrap
1281 msgid "2024-07-23"
1282 msgstr ""
1283
1284 #. type: TH
1285 #: fedora-44 fedora-rawhide
1286 #, no-wrap
1287 msgid "Linux man-pages 6.13"
1288 msgstr ""
1289
1290 #. type: Plain text
1291 #: fedora-44 fedora-rawhide
1292 #, no-wrap
1293 msgid ""
1294 "B<int waitid(idtype_t >I<idtype>B<, id_t >I<id>B<, siginfo_t *>I<infop>B<, int >I<options>B<);>\n"
1295 " /* This is the glibc and POSIX interface; see\n"
1296 " VERSIONS for information on the raw system call. */\n"
1297 msgstr ""
1298
1299 #. type: TH
1300 #: mageia-cauldron
1301 #, no-wrap
1302 msgid "Linux man-pages 6.17"
1303 msgstr ""
1304
1305 #. type: TH
1306 #: opensuse-leap-16-1 opensuse-tumbleweed
1307 #, no-wrap
1308 msgid "Linux man-pages (unreleased)"
1309 msgstr ""