1<sys/wait.h>(0P) POSIX Programmer's Manual <sys/wait.h>(0P)
2
3
4
6 sys/wait.h - declarations for waiting
7
9 #include <sys/wait.h>
10
12 The <sys/wait.h> header shall define the following symbolic constants
13 for use with waitpid():
14
15 WNOHANG
16 Do not hang if no status is available; return immediately.
17
18 WUNTRACED
19 Report status of stopped child process.
20
21
22 The <sys/wait.h> header shall define the following macros for analysis
23 of process status values:
24
25 WEXITSTATUS
26 Return exit status.
27
28 WIFCONTINUED
29 True if child has been continued.
30
31 WIFEXITED
32 True if child exited normally.
33
34 WIFSIGNALED
35 True if child exited due to uncaught signal.
36
37 WIFSTOPPED
38 True if child is currently stopped.
39
40 WSTOPSIG
41 Return signal number that caused process to stop.
42
43 WTERMSIG
44 Return signal number that caused process to terminate.
45
46
47 The following symbolic constants shall be defined as possible values
48 for the options argument to waitid():
49
50 WEXITED
51 Wait for processes that have exited.
52
53 WSTOPPED
54 Status is returned for any child that has stopped upon receipt
55 of a signal.
56
57 WCONTINUED
58 Status is returned for any child that was stopped and has been
59 continued.
60
61 WNOHANG
62 Return immediately if there are no children to wait for.
63
64 WNOWAIT
65 Keep the process whose status is returned in infop in a waitable
66 state.
67
68
69 The type idtype_t shall be defined as an enumeration type whose possi‐
70 ble values shall include at least the following: P_ALL P_PID P_PGID
71
72 The id_t and pid_t types shall be defined as described in <sys/types.h>
73 .
74
75 The siginfo_t type shall be defined as described in <signal.h> .
76
77 The rusage structure shall be defined as described in <sys/resource.h>
78 .
79
80 Inclusion of the <sys/wait.h> header may also make visible all symbols
81 from <signal.h> and <sys/resource.h>.
82
83 The following shall be declared as functions and may also be defined as
84 macros. Function prototypes shall be provided.
85
86
87 pid_t wait(int *);
88
89 int waitid(idtype_t, id_t, siginfo_t *, int);
90
91 pid_t waitpid(pid_t, int *, int);
92
93 The following sections are informative.
94
96 None.
97
99 None.
100
102 None.
103
105 <signal.h>, <sys/resource.h>, <sys/types.h>, the System Interfaces vol‐
106 ume of IEEE Std 1003.1-2001, wait(), waitid()
107
109 Portions of this text are reprinted and reproduced in electronic form
110 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
111 -- Portable Operating System Interface (POSIX), The Open Group Base
112 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
113 Electrical and Electronics Engineers, Inc and The Open Group. In the
114 event of any discrepancy between this version and the original IEEE and
115 The Open Group Standard, the original IEEE and The Open Group Standard
116 is the referee document. The original Standard can be obtained online
117 at http://www.opengroup.org/unix/online.html .
118
119
120
121IEEE/The Open Group 2003 <sys/wait.h>(0P)