summaryrefslogtreecommitdiffstats
path: root/otherlibs
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1996-01-08 10:19:02 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1996-01-08 10:19:02 +0000
commit76f2da82e24e11be6cc119197f56875afc74b50f (patch)
tree58defe95f5b181fb28a8aa32bf62fe6dcd362925 /otherlibs
parent02eba90dce53e2933e7f010d335c7a0052d13f83 (diff)
Test et inclusion de <sys/select.h>, en particulier pour AIX
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@601 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs')
-rw-r--r--otherlibs/threads/scheduler.c20
-rw-r--r--otherlibs/unix/select.c3
2 files changed, 19 insertions, 4 deletions
diff --git a/otherlibs/threads/scheduler.c b/otherlibs/threads/scheduler.c
index f87d25952..bc3f627c9 100644
--- a/otherlibs/threads/scheduler.c
+++ b/otherlibs/threads/scheduler.c
@@ -1,7 +1,3 @@
-#include <sys/time.h>
-#include <sys/types.h>
-#include <unistd.h>
-
#include "config.h"
#include "misc.h"
#include "mlvalues.h"
@@ -17,6 +13,22 @@
#include "Cannot compile libthreads, system calls missing"
#endif
+#include <sys/time.h>
+#include <sys/types.h>
+#include <unistd.h>
+#ifdef HAS_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
+#ifndef FD_ISSET
+typedef int fd_set;
+#define FD_SETSIZE (sizeof(int) * 8)
+#define FD_SET(fd,fds) (*(fds) |= 1 << (fd))
+#define FD_CLR(fd,fds) (*(fds) &= ~(1 << (fd)))
+#define FD_ISSET(fd,fds) (*(fds) & (1 << (fd)))
+#define FD_ZERO(fds) (*(fds) = 0)
+#endif
+
/* Configuration */
/* Initial size of stack when a thread is created (4 Ko) */
diff --git a/otherlibs/unix/select.c b/otherlibs/unix/select.c
index ae1f5600a..0e6d16ec8 100644
--- a/otherlibs/unix/select.c
+++ b/otherlibs/unix/select.c
@@ -20,6 +20,9 @@
#include <sys/types.h>
#include <sys/time.h>
+#ifdef HAS_SYS_SELECT_H
+#include <sys/select.h>
+#endif
#ifdef FD_ISSET
typedef fd_set file_descr_set;