diff options
Diffstat (limited to 'news4-posix.h')
-rw-r--r-- | news4-posix.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/news4-posix.h b/news4-posix.h new file mode 100644 index 000000000..874067934 --- /dev/null +++ b/news4-posix.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * Defines and prototypes specific to News4 system | ||
3 | */ | ||
4 | |||
5 | #ifndef _NEWS4_POSIX_H | ||
6 | #define _NEWS4_POSIX_H | ||
7 | |||
8 | #ifdef HAVE_NEWS4 | ||
9 | |||
10 | #include <sys/wait.h> | ||
11 | |||
12 | typedef long clock_t; | ||
13 | |||
14 | /* FILE */ | ||
15 | #define O_NONBLOCK 00004 /* non-blocking open */ | ||
16 | |||
17 | /* WAITPID */ | ||
18 | #undef WIFEXITED | ||
19 | #undef WIFSTOPPED | ||
20 | #undef WIFSIGNALED | ||
21 | |||
22 | #define _W_INT(w) (*(int*)&(w)) /* convert union wait to int */ | ||
23 | #define WIFEXITED(w) (!((_W_INT(w)) & 0377)) | ||
24 | #define WIFSTOPPED(w) ((_W_INT(w)) & 0100) | ||
25 | #define WIFSIGNALED(w) (!WIFEXITED(w) && !WIFSTOPPED(w)) | ||
26 | #define WEXITSTATUS(w) (int)(WIFEXITED(w) ? ((_W_INT(w) >> 8) & 0377) : -1) | ||
27 | #define WTERMSIG(w) (int)(WIFSIGNALED(w) ? (_W_INT(w) & 0177) : -1) | ||
28 | #define WCOREFLAG 0x80 | ||
29 | #define WCOREDUMP(w) ((_W_INT(w)) & WCOREFLAG) | ||
30 | |||
31 | int waitpid(int pid,int *stat_loc,int options); | ||
32 | #define setsid() setpgrp(0, getpid()) | ||
33 | |||
34 | #endif /* HAVE_NEWS4 */ | ||
35 | #endif /* _NEWS4_POSIX_H */ | ||