Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use kqueue on FreeBSD too

  • Loading branch information...
commit 3fe7e8049c3f0e81f63bd3a140ab111b6ffef5d9 1 parent d6dede8
@fperrin fperrin authored
Showing with 5 additions and 7 deletions.
  1. +5 −7 appruntime/io/binding_epoll.c
View
12 appruntime/io/binding_epoll.c
@@ -75,13 +75,11 @@ value ep_close(value fd)
CAMLreturn(Val_int(close(fd)));
}
-#ifdef __APPLE__
-#ifdef __MACH__
-#define __APPLE__MACH__
-#endif
+#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#define USE_KQUEUE
#endif
-#ifdef __APPLE__MACH__
+#ifdef USE_KQUEUE
#include <sys/types.h>
#include <sys/event.h>
@@ -246,7 +244,7 @@ EXPORT(EPOLLHUP, EV_ERROR); // TODO with a hang up like event
//TODO //EXPORT(EPOLLET);
//TODO //EXPORT(EPOLLONESHOT);
-#else
+#else /* not USE_KQUEUE */
#include <sys/epoll.h>
@@ -344,7 +342,7 @@ SIMPLE_EXPORT(EPOLLERR)
SIMPLE_EXPORT(EPOLLET)
SIMPLE_EXPORT(EPOLLONESHOT)*/
-#endif // __APPLE__MACH__ FALSE BRANCH
+#endif // USE_KQUEUE FALSE BRANCH
#endif // MLSTATE_UNIX
Please sign in to comment.
Something went wrong with that request. Please try again.