6 #define WNOHANG 1 /* Don't hang in wait. */
7 #define WUNTRACED 2 /* Tell about stopped, untraced children. */
8 #define WCONTINUED 4 /* Report a job control continued process. */
9 #define _W_INT(w) (*(int *)&(w)) /* Convert union wait to int. */
10 #define WCOREFLAG 0200
12 #define _WSTATUS(x) (_W_INT(x) & 0177)
13 #define _WSTOPPED 0177 /* _WSTATUS if process is stopped */
14 #define WIFSTOPPED(x) (_WSTATUS(x) == _WSTOPPED)
15 #define WSTOPSIG(x) (_W_INT(x) >> 8)
16 #define WIFSIGNALED(x) (_WSTATUS(x) != 0 && !WIFSTOPPED(x) && !WIFCONTINUED(x)) /* bird: made GLIBC tests happy. */
17 #define WTERMSIG(x) (_WSTATUS(x))
18 #define WIFEXITED(x) (_WSTATUS(x) == 0)
19 #define WEXITSTATUS(x) (_W_INT(x) >> 8)
20 #define WIFCONTINUED(x) (x == 0x13) /* 0x13 == SIGCONT */
21 #define WCOREDUMP(x) (_W_INT(x) & WCOREFLAG)
22 #define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
23 #define W_STOPCODE(sig) ((sig) << 8 | _WSTOPPED)