From e5a8525242deb13d5263d2da46365053f05262d4 Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Thu, 19 Oct 2000 23:43:24 +0000 Subject: - (bal) Imported NEWS-OS waitpid() macros into NeXT. Since implementation is more correct then current version. --- next-posix.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'next-posix.h') 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 @@ #undef WIFSTOPPED #undef WIFSIGNALED -#define WIFEXITED(w) (!((w) & 0377)) -#define WIFSTOPPED(w) ((w) & 0100) +#define _W_INT(w) (*(int*)&(w)) /* convert union wait to int */ +#define WIFEXITED(w) (!((_W_INT(w)) & 0377)) +#define WIFSTOPPED(w) ((_W_INT(w)) & 0100) #define WIFSIGNALED(w) (!WIFEXITED(w) && !WIFSTOPPED(w)) -#define WEXITSTATUS(w) (int)(WIFEXITED(w) ? (((w) >> 8) & 0377) : -1) -#define WTERMSIG(w) (int)(WIFSIGNALED(w) ? ((w) & 0177) : -1) +#define WEXITSTATUS(w) (int)(WIFEXITED(w) ? ((_W_INT(w) >> 8) & 0377) : -1) +#define WTERMSIG(w) (int)(WIFSIGNALED(w) ? (_W_INT(w) & 0177) : -1) +#define WCOREFLAG 0x80 +#define WCOREDUMP(w) ((_W_INT(w)) & WCOREFLAG) /* Swap out the next 'BSDish' wait() for a more POSIX complient one */ pid_t posix_wait(int *status); -- cgit v1.2.3