summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--process.c19
2 files changed, 23 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 36be371049..de4cea5597 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Feb 20 23:45:35 2001 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * process.c: add W* macro if not available.
+
Tue Feb 20 16:37:58 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* configure.in: add check for negative time_t for gmtime(3).
diff --git a/process.c b/process.c
index 85b205831f..7f62331d83 100644
--- a/process.c
+++ b/process.c
@@ -57,6 +57,25 @@ struct timeval rb_time_interval _((VALUE));
static VALUE S_Tms;
#endif
+#ifndef WIFEXITED
+#define WIFEXITED(w) (((w) & 0xff) == 0)
+#endif
+#ifndef WIFSIGNALED
+#define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f))
+#endif
+#ifndef WIFSTOPPED
+#define WIFSTOPPED(w) (((w) & 0xff) == 0x7f)
+#endif
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(w) (((w) >> 8) & 0xff)
+#endif
+#ifndef WTERMSIG
+#define WTERMSIG(w) ((w) & 0x7f)
+#endif
+#ifndef WSTOPSIG
+#define WSTOPSIG WEXITSTATUS
+#endif
+
static VALUE
get_pid()
{