summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1996-06-25 09:54:46 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1996-06-25 09:54:46 +0000
commit896da9682e1ead0e42755bfaaeb9cb7d06ba474f (patch)
tree040a2ec20397c09de5eba01d1e8d50e1079a75d4
parent0965c6ed41fe018fcb12311ac2fb469d8ddc2cdc (diff)
Utiliser wait4 si waitpid non disponible.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@906 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--otherlibs/threads/scheduler.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/otherlibs/threads/scheduler.c b/otherlibs/threads/scheduler.c
index 33a02be5b..ff627f77c 100644
--- a/otherlibs/threads/scheduler.c
+++ b/otherlibs/threads/scheduler.c
@@ -26,7 +26,8 @@
#if ! (defined(HAS_SELECT) && \
defined(HAS_SETITIMER) && \
- defined(HAS_GETTIMEOFDAY))
+ defined(HAS_GETTIMEOFDAY) && \
+ (defined(HAS_WAITPID) || defined(HAS_WAIT4)))
#include "Cannot compile libthreads, system calls missing"
#endif
@@ -50,6 +51,10 @@ typedef int fd_set;
#define FD_ZERO(fds) (*(fds) = 0)
#endif
+#ifndef HAS_WAITPID
+#define waitpid(pid,status,opts) wait4(pid,status,opts,NULL)
+#endif
+
/* Configuration */
/* Initial size of stack when a thread is created (4 Ko) */