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 .TH WAIT4 2 2010-09-20 "Linux" "Linux Programmer's Manual"
36 wait3, wait4 \- wait for process to change state, BSD style
39 .B #include <sys/types.h>
40 .B #include <sys/time.h>
41 .B #include <sys/resource.h>
42 .B #include <sys/wait.h>
44 .BI "pid_t wait3(int *" "status" ", int " options ,
45 .BI " struct rusage *" rusage );
47 .BI "pid_t wait4(pid_t " pid ", int *" status ", int " options ,
48 .BI " struct rusage *" rusage );
52 Feature Test Macro Requirements for glibc (see
53 .BR feature_test_macros (7)):
59 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
60 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
73 system calls are similar to
75 but additionally return resource usage information about the
76 child in the structure pointed to by
79 Other than the use of the
81 argument, the following
86 wait3(status, options, rusage);
92 waitpid(\-1, status, options);
95 Similarly, the following
100 wait4(pid, status, options, rusage);
106 waitpid(pid, status, options);
111 waits of any child, while
113 can be used to select a specific child, or children, on which to wait.
122 to which it points will be filled with accounting information
138 is not required these days, but increases portability.
143 structure with fields of type
150 is a library function implemented on top of the