+#include <config.h>
+
+#ifdef HOST_WIN32
+/* For select */
+#include <winsock2.h>
+#endif
+
#include "mono-poll.h"
#include <errno.h>
-#ifdef HAVE_POLL
+#ifdef DISABLE_SOCKETS
+#include <glib.h>
+
+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)
{
if (fd < 0)
continue;
-#ifdef PLATFORM_WIN32
+#ifdef HOST_WIN32
if (nexc >= FD_SETSIZE) {
ufds [i].revents = MONO_POLLNVAL;
return 1;
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;
#endif
+#endif /* #ifndef DISABLE_SOCKETS */