X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Futils%2Fmono-poll.c;h=5e5adfe2f0009e64f32907f1750abc671ce1376a;hb=4320e844e92386319c01095435e6ae0c67bfc09a;hp=4bd3f376eb815e8c2905b181d8c8c94267c3e462;hpb=89d0ba3968d36576553e0f483b0c69465f94e8ae;p=mono.git diff --git a/mono/utils/mono-poll.c b/mono/utils/mono-poll.c old mode 100644 new mode 100755 index 4bd3f376eb8..5e5adfe2f00 --- a/mono/utils/mono-poll.c +++ b/mono/utils/mono-poll.c @@ -1,7 +1,18 @@ #include "mono-poll.h" #include -#ifdef HAVE_POLL +#ifdef DISABLE_SOCKETS +#include + +int +mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout) +{ + g_assert_not_reached (); + return -1; +} +#else + +#if defined(HAVE_POLL) && !defined(__APPLE__) int mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout) { @@ -9,6 +20,11 @@ mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout) } #else +#ifdef HOST_WIN32 +/* For select */ +#include +#endif + int mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout) { @@ -36,7 +52,7 @@ mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout) if (fd < 0) continue; -#ifdef PLATFORM_WIN32 +#ifdef HOST_WIN32 if (nexc >= FD_SETSIZE) { ufds [i].revents = MONO_POLLNVAL; return 1; @@ -64,7 +80,7 @@ mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout) affected = select (maxfd + 1, &rfds, &wfds, &efds, tvptr); if (affected == -1) { -#ifdef PLATFORM_WIN32 +#ifdef HOST_WIN32 int error = WSAGetLastError (); switch (error) { case WSAEFAULT: errno = EFAULT; break; @@ -114,3 +130,4 @@ mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout) #endif +#endif /* #ifndef DISABLE_SOCKETS */