diff options
| author | Dave Love | 2000-07-26 11:06:05 +0000 |
|---|---|---|
| committer | Dave Love | 2000-07-26 11:06:05 +0000 |
| commit | 1f0bb0abf84a7c31908beb4818329a6d496a0344 (patch) | |
| tree | 9fa94e0fa49e67842365ab57115be00b52ed1348 /src | |
| parent | 48989eadcb40bed1cd406992c14a0e7243915c11 (diff) | |
| download | emacs-1f0bb0abf84a7c31908beb4818329a6d496a0344.tar.gz emacs-1f0bb0abf84a7c31908beb4818329a6d496a0344.zip | |
Move some definitions.
(HAVE_SYS_WAIT_H): Undef for HPUX7, Convex.
[!HAVE_SYS_WAIT_H]: Define things unconditionally. More
perspicuous definitions.
(WTERMSIG): Fix bit pattern used.
Diffstat (limited to 'src')
| -rw-r--r-- | src/syswait.h | 77 |
1 files changed, 37 insertions, 40 deletions
diff --git a/src/syswait.h b/src/syswait.h index d3edfdf0768..692c202da1b 100644 --- a/src/syswait.h +++ b/src/syswait.h | |||
| @@ -32,52 +32,49 @@ Boston, MA 02111-1307, USA. */ | |||
| 32 | below. */ | 32 | below. */ |
| 33 | 33 | ||
| 34 | #if 1 | 34 | #if 1 |
| 35 | #undef WAITTYPE | ||
| 36 | #define WAITTYPE int | ||
| 37 | #define WRETCODE(w) WEXITSTATUS (w) | ||
| 38 | |||
| 39 | #include <sys/types.h> | 35 | #include <sys/types.h> |
| 40 | #if HAVE_SYS_WAIT_H | 36 | |
| 37 | /* Old code included a comment that HPUX version 7 has broken | ||
| 38 | definitions of some of the macros and `the convex' does too. | ||
| 39 | HAVE_SYS_WAIT_H probably won't be defined on them if they still get | ||
| 40 | used, but for safety... -- fx */ | ||
| 41 | #if (defined (HPUX) && !defined (HPUX8)) || defined (convex) | ||
| 42 | #undef HAVE_SYS_WAIT_H | ||
| 43 | #endif | ||
| 44 | |||
| 45 | #if defined HAVE_SYS_WAIT_H /* We have sys/wait.h with POSIXoid | ||
| 46 | definitions. */ | ||
| 47 | |||
| 41 | #include <sys/wait.h> | 48 | #include <sys/wait.h> |
| 49 | #ifndef WCOREDUMP /* not POSIX */ | ||
| 50 | #define WCOREDUMP(status) ((status) & 0x80) | ||
| 42 | #endif | 51 | #endif |
| 43 | 52 | ||
| 44 | #if defined (HPUX) || defined (convex) | 53 | #else /* !HAVE_SYS_WAIT_H */ |
| 45 | /* HPUX version 7 has broken definitions of these. */ | 54 | |
| 46 | /* pvogel@convex.com says the convex does too. */ | 55 | /* Note that sys/wait.h may still be included by stdlib.h or something |
| 47 | #undef WTERMSIG | 56 | according to XPG. */ |
| 48 | #undef WSTOPSIG | 57 | |
| 58 | #undef WEXITSTATUS | ||
| 59 | #define WEXITSTATUS(status) (((status) & 0xff00) >> 8) | ||
| 60 | #undef WIFEXITED | ||
| 61 | #define WIFEXITED(status) (WTERMSIG(status) == 0) | ||
| 49 | #undef WIFSTOPPED | 62 | #undef WIFSTOPPED |
| 63 | #define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) | ||
| 50 | #undef WIFSIGNALED | 64 | #undef WIFSIGNALED |
| 51 | #undef WIFEXITED | 65 | #define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status)) |
| 52 | #endif /* HPUX || convex */ | 66 | #undef WSTOPSIG |
| 67 | #define WSTOPSIG(status) WEXITSTATUS(status) | ||
| 68 | #undef WTERMSIG | ||
| 69 | #define WTERMSIG(status) ((status) & 0x7f) | ||
| 70 | #undef WCOREDUMP | ||
| 71 | #define WCOREDUMP(status) ((status) & 0x80) | ||
| 72 | #endif /* HAVE_SYS_WAIT_H */ | ||
| 53 | 73 | ||
| 54 | #ifndef WEXITSTATUS | 74 | #undef WAITTYPE |
| 55 | # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) | 75 | #define WAITTYPE int |
| 56 | #endif | 76 | #undef WRETCODE |
| 57 | #ifndef WIFEXITED | 77 | #define WRETCODE(status) WEXITSTATUS (status) |
| 58 | # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) | ||
| 59 | #endif | ||
| 60 | #ifndef WIFSTOPPED | ||
| 61 | #define WIFSTOPPED(w) ((w&0377) == 0177) | ||
| 62 | #endif | ||
| 63 | #ifndef WIFSIGNALED | ||
| 64 | #define WIFSIGNALED(w) ((w&0377) != 0177 && (w&~0377) == 0) | ||
| 65 | #endif | ||
| 66 | #ifndef WIFEXITED | ||
| 67 | #define WIFEXITED(w) ((w&0377) == 0) | ||
| 68 | #endif | ||
| 69 | #ifndef WRETCODE | ||
| 70 | #define WRETCODE(w) (w >> 8) | ||
| 71 | #endif | ||
| 72 | #ifndef WSTOPSIG | ||
| 73 | #define WSTOPSIG(w) (w >> 8) | ||
| 74 | #endif | ||
| 75 | #ifndef WTERMSIG | ||
| 76 | #define WTERMSIG(w) (w & 0377) | ||
| 77 | #endif | ||
| 78 | #ifndef WCOREDUMP | ||
| 79 | #define WCOREDUMP(w) ((w&0200) != 0) | ||
| 80 | #endif | ||
| 81 | 78 | ||
| 82 | #else /* !1 */ | 79 | #else /* !1 */ |
| 83 | 80 | ||
| @@ -99,7 +96,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 99 | #define WIFEXITED(w) ((w&0377) == 0) | 96 | #define WIFEXITED(w) ((w&0377) == 0) |
| 100 | #define WRETCODE(w) (w >> 8) | 97 | #define WRETCODE(w) (w >> 8) |
| 101 | #define WSTOPSIG(w) (w >> 8) | 98 | #define WSTOPSIG(w) (w >> 8) |
| 102 | #define WTERMSIG(w) (w & 0377) | 99 | #define WTERMSIG(w) (w & 0177) |
| 103 | #ifndef WCOREDUMP | 100 | #ifndef WCOREDUMP |
| 104 | #define WCOREDUMP(w) ((w&0200) != 0) | 101 | #define WCOREDUMP(w) ((w&0200) != 0) |
| 105 | #endif | 102 | #endif |