diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 1996-01-08 10:19:02 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 1996-01-08 10:19:02 +0000 |
commit | 76f2da82e24e11be6cc119197f56875afc74b50f (patch) | |
tree | 58defe95f5b181fb28a8aa32bf62fe6dcd362925 /otherlibs/threads/scheduler.c | |
parent | 02eba90dce53e2933e7f010d335c7a0052d13f83 (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/threads/scheduler.c')
-rw-r--r-- | otherlibs/threads/scheduler.c | 20 |
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) */ |