summaryrefslogtreecommitdiffstats
path: root/otherlibs/threads/scheduler.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/threads/scheduler.c')
-rw-r--r--otherlibs/threads/scheduler.c20
1 files changed, 16 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) */