1sys_wait.h(0P) POSIX Programmer's Manual sys_wait.h(0P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 sys/wait.h — declarations for waiting
13
15 #include <sys/wait.h>
16
18 The <sys/wait.h> header shall define the following symbolic constants
19 for use with waitpid():
20
21 WCONTINUED Report status of continued child process.
22
23 WNOHANG Do not hang if no status is available; return immedi‐
24 ately.
25
26 WUNTRACED Report status of stopped child process.
27
28 The <sys/wait.h> header shall define the following macros for analysis
29 of process status values:
30
31 WEXITSTATUS Return exit status.
32
33 WIFCONTINUED True if child has been continued.
34
35 WIFEXITED True if child exited normally.
36
37 WIFSIGNALED True if child exited due to uncaught signal.
38
39 WIFSTOPPED True if child is currently stopped.
40
41 WSTOPSIG Return signal number that caused process to stop.
42
43 WTERMSIG Return signal number that caused process to terminate.
44
45 The <sys/wait.h> header shall define the following symbolic constants
46 as possible values for the options argument to waitid():
47
48 WEXITED Wait for processes that have exited.
49
50 WNOWAIT Keep the process whose status is returned in infop in a
51 waitable state.
52
53 WSTOPPED Status is returned for any child that has stopped upon
54 receipt of a signal.
55
56 The WCONTINUED and WNOHANG constants, described above for waitpid(),
57 can also be used with waitid().
58
59 The type idtype_t shall be defined as an enumeration type whose possi‐
60 ble values shall include at least the following: P_ALL P_PGID P_PID
61
62 The <sys/wait.h> header shall define the id_t and pid_t types as
63 described in <sys/types.h>.
64
65 The <sys/wait.h> header shall define the siginfo_t type and the sigval
66 union as described in <signal.h>.
67
68 Inclusion of the <sys/wait.h> header may also make visible all symbols
69 from <signal.h>.
70
71 The following shall be declared as functions and may also be defined as
72 macros. Function prototypes shall be provided.
73
74
75 pid_t wait(int *);
76 int waitid(idtype_t, id_t, siginfo_t *, int);
77 pid_t waitpid(pid_t, int *, int);
78
79 The following sections are informative.
80
82 None.
83
85 None.
86
88 None.
89
91 <signal.h>, <sys_resource.h>, <sys_types.h>
92
93 The System Interfaces volume of POSIX.1‐2017, wait(), waitid()
94
96 Portions of this text are reprinted and reproduced in electronic form
97 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
98 table Operating System Interface (POSIX), The Open Group Base Specifi‐
99 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
100 Electrical and Electronics Engineers, Inc and The Open Group. In the
101 event of any discrepancy between this version and the original IEEE and
102 The Open Group Standard, the original IEEE and The Open Group Standard
103 is the referee document. The original Standard can be obtained online
104 at http://www.opengroup.org/unix/online.html .
105
106 Any typographical or formatting errors that appear in this page are
107 most likely to have been introduced during the conversion of the source
108 files to man page format. To report such errors, see https://www.ker‐
109 nel.org/doc/man-pages/reporting_bugs.html .
110
111
112
113IEEE/The Open Group 2017 sys_wait.h(0P)