summaryrefslogtreecommitdiff
path: root/next-posix.h
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2000-10-19 23:43:24 +0000
committerBen Lindstrom <mouring@eviladmin.org>2000-10-19 23:43:24 +0000
commite5a8525242deb13d5263d2da46365053f05262d4 (patch)
tree63e417a8b80f3c1b3840b2bb0894bb772db21566 /next-posix.h
parent81fa28abaab971695cb4a855e9363bc766613d18 (diff)
- (bal) Imported NEWS-OS waitpid() macros into NeXT. Since implementation
is more correct then current version.
Diffstat (limited to 'next-posix.h')
-rw-r--r--next-posix.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/next-posix.h b/next-posix.h
index 3ac4739d0..bd815af43 100644
--- a/next-posix.h
+++ b/next-posix.h
@@ -39,11 +39,14 @@
39#undef WIFSTOPPED 39#undef WIFSTOPPED
40#undef WIFSIGNALED 40#undef WIFSIGNALED
41 41
42#define WIFEXITED(w) (!((w) & 0377)) 42#define _W_INT(w) (*(int*)&(w)) /* convert union wait to int */
43#define WIFSTOPPED(w) ((w) & 0100) 43#define WIFEXITED(w) (!((_W_INT(w)) & 0377))
44#define WIFSTOPPED(w) ((_W_INT(w)) & 0100)
44#define WIFSIGNALED(w) (!WIFEXITED(w) && !WIFSTOPPED(w)) 45#define WIFSIGNALED(w) (!WIFEXITED(w) && !WIFSTOPPED(w))
45#define WEXITSTATUS(w) (int)(WIFEXITED(w) ? (((w) >> 8) & 0377) : -1) 46#define WEXITSTATUS(w) (int)(WIFEXITED(w) ? ((_W_INT(w) >> 8) & 0377) : -1)
46#define WTERMSIG(w) (int)(WIFSIGNALED(w) ? ((w) & 0177) : -1) 47#define WTERMSIG(w) (int)(WIFSIGNALED(w) ? (_W_INT(w) & 0177) : -1)
48#define WCOREFLAG 0x80
49#define WCOREDUMP(w) ((_W_INT(w)) & WCOREFLAG)
47 50
48/* Swap out the next 'BSDish' wait() for a more POSIX complient one */ 51/* Swap out the next 'BSDish' wait() for a more POSIX complient one */
49pid_t posix_wait(int *status); 52pid_t posix_wait(int *status);