From 75c6b4aaf091e76e31f69a14b29c1dfadd6c06f2 Mon Sep 17 00:00:00 2001 From: tgoodwin Date: Tue, 7 Jul 1998 15:08:45 +0000 Subject: use POSIX wait() macros --- rc.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'rc.h') diff --git a/rc.h b/rc.h index 681dd9c..9f1fc5d 100644 --- a/rc.h +++ b/rc.h @@ -10,6 +10,28 @@ #include #endif +#if HAVE_SYS_WAIT_H +#include +#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 #endif @@ -414,7 +436,6 @@ extern pid_t rc_wait(int *); #else /* HAVE_RESTARTABLE_SYSCALLS */ #define rc_read read -#include #define rc_wait wait #endif /* HAVE_RESTARTABLE_SYSCALLS */ -- cgit v1.2.3