diff --git a/ChangeLog b/ChangeLog index 614f3d93d..a0cc51185 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 20001020 - (djm) Don't define _REENTRANT for SNI/Reliant Unix + - (bal) Imported NEWS-OS waitpid() macros into NeXT. Since implementation + is more correct then current version. 20001018 - (stevesk) Add initial support for setproctitle(). Current 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);