Module: wine Branch: master Commit: 8143d42c4c477c4ad88badd995987d0a8710b4fa URL: http://source.winehq.org/git/wine.git/?a=commit;h=8143d42c4c477c4ad88badd995...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Jun 15 12:41:43 2007 +0200
server: Enable kqueue support on Mac OS >= 10.5 now that it's fixed.
---
server/fd.c | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/server/fd.c b/server/fd.c index 11cf294..7a7d572 100644 --- a/server/fd.c +++ b/server/fd.c @@ -55,6 +55,9 @@ #ifdef HAVE_SYS_STATFS_H #include <sys/statfs.h> #endif +#ifdef HAVE_SYS_SYSCTL_H +#include <sys/sysctl.h> +#endif #ifdef HAVE_SYS_EVENT_H #include <sys/event.h> #undef LIST_INIT @@ -518,9 +521,17 @@ static int kqueue_fd = -1;
static inline void init_epoll(void) { -#ifndef __APPLE__ /* kqueue support is broken in the MacOS kernel so we can't use it */ - kqueue_fd = kqueue(); +#ifdef __APPLE__ /* kqueue support is broken in Mac OS < 10.5 */ + int mib[2]; + char release[32]; + size_t len = sizeof(release); + + mib[0] = CTL_KERN; + mib[1] = KERN_OSRELEASE; + if (sysctl( mib, 2, release, &len, NULL, 0 ) == -1) return; + if (atoi(release) < 9) return; #endif + kqueue_fd = kqueue(); }
static inline void set_fd_epoll_events( struct fd *fd, int user, int events )