First public contribution.
1 /** @file ../include/sys/wait.h
5 /** @fn wait(int *status)
8 Note: This description also covers the following functions -
11 @return If wait returns due to a stopped
12 or terminated child process, the process ID of the child
13 is returned to the calling process.
14 Otherwise, a value of -1
15 is returned and errno is set to indicate the error. If wait4 , wait3 ,
16 or waitpid returns due to a stopped
17 or terminated child process, the process ID of the child
18 is returned to the calling process.
19 If there are no children not previously awaited,
20 -1 is returned with errno set to ECHILD .
21 Otherwise, if WNOHANG is specified and there are
22 no stopped or exited children,
24 If an error is detected or a caught signal aborts the call,
26 is returned and errno is set to indicate the error.
28 The wait function suspends execution of its calling process until status information is available for a terminated child process,
29 or a signal is received.
30 On return from a successful wait call,
31 the status area contains termination information about the process that exited
34 The wpid argument specifies the set of child processes for which to wait.
35 If wpid is -1, the call waits for any child process.
37 the call waits for any child process in the process group of the caller.
38 If wpid is greater than zero, the call waits for the process with process id wpid .
39 If wpid is less than -1, the call waits for any process whose process group id
40 equals the absolute value of wpid .
46 The waitpid function is identical to wait4 with an rusage value of zero.
50 The waitpid function waits for a process ID which is obtained using a
51 non-standard API popen3
69 /** @fn waitpid(pid_t wpid, int *status, int options)
74 Refer to wait() for the documentation
89 Macros to test the exit status returned by wait and extract the relevant values. Convert union wait to int.
97 Macros to test the exit status returned by wait and extract the relevant values.
100 @externallyDefinedApi
105 Macros to test the exit status returned by wait and extract the relevant values.
113 Macros to test the exit status returned by wait and extract the relevant values.
119 /** @def WIFSTOPPED(x)
121 Macros to test the exit status returned by wait and extract the relevant values.
124 @externallyDefinedApi
129 Macros to test the exit status returned by wait and extract the relevant values.
132 @externallyDefinedApi
135 /** @def WIFSIGNALED(x)
137 Macros to test the exit status returned by wait and extract the relevant values.
140 @externallyDefinedApi
145 Macros to test the exit status returned by wait and extract the relevant values.
148 @externallyDefinedApi
151 /** @def WIFEXITED(x)
153 Macros to test the exit status returned by wait and extract the relevant values.
156 @externallyDefinedApi
159 /** @def WEXITSTATUS(x)
161 Macros to test the exit status returned by wait and extract the relevant values.
164 @externallyDefinedApi
167 /** @def WIFCONTINUED(x)
169 Macros to test the exit status returned by wait and extract the relevant values.
172 @externallyDefinedApi
175 /** @def WCOREDUMP(x)
177 Macros to test the exit status returned by wait and extract the relevant values.
180 @externallyDefinedApi
184 /** @def W_EXITCODE(ret, sig)
186 Macros to test the exit status returned by wait and extract the relevant values.
189 @externallyDefinedApi
192 /** @def W_STOPCODE(sig)
194 Macros to test the exit status returned by wait and extract the relevant values.
197 @externallyDefinedApi
200 /** @def WIFTERMINATED(x)
202 Macros to test the termination code returned by wait and extract the relevant values.
205 @externallyDefinedApi
208 /** @def WTERMINATESTATUS(x)
210 Macros to test the termination code returned by wait and extract the relevant values.
213 @externallyDefinedApi
216 /** @def WIFPANICED(x)
218 Macros to test the panic code returned by wait and extract the relevant values.
221 @externallyDefinedApi
224 /** @def WPANICCODE(x)
226 Macros to test the panic code returned by wait and extract the relevant values.
229 @externallyDefinedApi
237 @externallyDefinedApi
242 Tell about stopped, untraced children.
245 @externallyDefinedApi
250 Report a job control continued process.
253 @externallyDefinedApi
259 Any process. Tokens for special values of the pid parameter to wait4.
268 Macros to test the exit status returned by wait and extract the relevant values.
277 Wait for kthread spawned from linux_clone.
286 Tokens for special values of the pid parameter to wait4. Any process in my process group.