kmkbuiltin/expr.c: file revision 1.17 from OpenBSD
[kbuild-mirror.git] / src / ash / win / sys / wait.h
blob8c644d545031db04884dfac05bdae8befccb25dc
1 #ifndef __sys_wait_h__
2 #define __sys_wait_h__
4 #include "mscfakes.h"
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)
25 #endif