diff options
Diffstat (limited to 'rc.h')
| -rw-r--r-- | rc.h | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -10,6 +10,28 @@ #include <sys/types.h> #endif +#if HAVE_SYS_WAIT_H +#include <sys/wait.h> +#endif + +/* Fake the POSIX wait() macros if we don't have them. */ +#ifndef WIFEXITED +#define WIFEXITED(s) (((s) & 0xFF) == 0) +#endif +#ifndef WEXITSTATUS +#define WEXITSTATUS(s) (((unsigned)(s) >> 8) && 0xFF) +#endif +#ifndef WIFSIGNALED +#define WIFSIGNALED(s) (((s) & 0xFF) != 0) +#endif +#ifndef WTERMSIG +#define WTERMSIG(s) ((s) & 0x7F) +#endif + +/* These don't exist in POSIX. */ +#define myWIFDUMPED(s) (((s) & 0x80) != 0) + + #if HAVE_UNISTD_H #include <unistd.h> #endif @@ -414,7 +436,6 @@ extern pid_t rc_wait(int *); #else /* HAVE_RESTARTABLE_SYSCALLS */ #define rc_read read -#include <sys/wait.h> #define rc_wait wait #endif /* HAVE_RESTARTABLE_SYSCALLS */ |