diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | next-posix.h | 11 |
2 files changed, 9 insertions, 4 deletions
@@ -1,5 +1,7 @@ | |||
1 | 20001020 | 1 | 20001020 |
2 | - (djm) Don't define _REENTRANT for SNI/Reliant Unix | 2 | - (djm) Don't define _REENTRANT for SNI/Reliant Unix |
3 | - (bal) Imported NEWS-OS waitpid() macros into NeXT. Since implementation | ||
4 | is more correct then current version. | ||
3 | 5 | ||
4 | 20001018 | 6 | 20001018 |
5 | - (stevesk) Add initial support for setproctitle(). Current | 7 | - (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 @@ | |||
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 */ |
49 | pid_t posix_wait(int *status); | 52 | pid_t posix_wait(int *status); |