|
|
1.1 root 1: /*
2: * POSIX <sys/wait.h>
3: */
4:
5: #if __STDC__
6: #define ARGS(args) args
7: #else
8: #define ARGS(args) ()
9: #endif
10:
11: #if 1
12: typedef int pid_t; /* belong in sys/types.h */
13: #endif
14:
15: /* waitpid options */
16: #define WNOHANG 1 /* don't hang in wait */
17: #define WUNTRACED 2 /* tell about stopped, untraced children */
18:
19: #define WSTOPPED 0x7F /* process is stopped */
20:
21: #define WIFSTOPPED(x) (((x)&0xFF) == 0x7F)
22: #define WIFSIGNALED(x) (((x)&0xFF) != 0x7F && ((x)&0x7F) != 0)
23: #define WIFEXITED(x) (((x)&0xFF) != 0x7F && ((x)&0x7F) == 0)
24: #define WIFCORED(x) (!!((x)&0x80)) /* non-standard */
25: #define WEXITSTATUS(x) ((x)>>8&0xFF)
26: #define WTERMSIG(x) ((x)&0x7F)
27: #define WSTOPSIG(x) ((x)>>8&0xFF)
28:
29: pid_t wait ARGS((int *statp));
30: #if _BSD
31: pid_t wait3 ARGS((int *statp, int options, Void *));
32: /* todo: does not emulate pid argument */
33: #define waitpid(pid, sp, opts) wait3(sp, opts, (Void*)NULL)
34: #else
35: pid_t waitpid ARGS((pid_t pid, int *statp, int options));
36: #endif
37:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.