|
|
1.1 root 1: #ifndef __COMMON__WAIT_H__
2: #define __COMMON__WAIT_H__
3:
4: /*
5: * This internal header file is intended as the sole point of definition for
6: * the manifest constants and macros related to the POSIX.1 wait () system
7: * call. The definitions of these constants and macros is kept here to avoid
8: * entanglement in namespace-reservation issues.
9: *
10: * Note that the POSIX.1 standard does not require that the W... contants be
11: * integral constant expressions suitable for use in #if-expressions, so we
12: * use that freedom to built enumerations instead.
13: */
14:
15: enum {
16: __WSIGMASK = 0x7F,
17: __WSTOPFLG = 0x7F,
18: __WCOREFLG = 0x80,
19:
20: __WEXITED = 1,
21: __WTRAPPED = 2,
22: __WCONTINUED = 8,
23:
24: __WUNTRACED = 4,
25: __WNOHANG = 64,
26: __WNOWAIT = 128
27: };
28:
29: #define __WCONTFLAG 0xFFFF
30:
31: #define __WIFCONTINUED(stat) (((stat) & __WCONTFLAG) == __WCONTFLAG)
32: #define __WCOREDUMP(stat) ((stat) & __WCOREFLG)
33:
34: #define __WLOBYTE(stat) ((stat) & 0xFF)
35: #define __WHIBYTE(stat) (((stat) >> 8) & 0xFF)
36:
37: #define __WIFEXITED(stat) (__WLOBYTE (stat) == 0)
38: #define __WEXITSTATUS(stat) (__WHIBYTE (stat))
39:
40: #define __WIFSIGNALED(stat) (__WLOBYTE (stat) > 0 && __WHIBYTE (stat) == 0)
41: #define __WTERMSIG(stat) (__WLOBYTE (stat) & __WSIGMASK)
42:
43: #define __WIFSTOPPED(stat) (__WLOBYTE (stat) == __WSTOPFLG && \
44: __WHIBYTE (stat) != 0)
45: #define __WSTOPSIG(stat) (__WHIBYTE (stat))
46:
47: #endif /* ! defined (__COMMON__WAIT_H__) */
48:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.