Index: mono/io-layer/sockets.c
===================================================================
--- mono/io-layer/sockets.c	(revision 5128)
+++ mono/io-layer/sockets.c	(working copy)
@@ -15,7 +15,6 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <sys/poll.h>
 #ifdef HAVE_SYS_FILIO_H
 #include <sys/filio.h>     /* defines FIONBIO and FIONREAD */
 #endif
@@ -34,7 +33,7 @@
 #include <mono/io-layer/socket-private.h>
 #include <mono/io-layer/handles-private.h>
 #include <mono/io-layer/socket-wrappers.h>
-
+#include <mono/utils/mono-poll.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
 #include <netdb.h>
@@ -303,7 +302,7 @@
 	}
 	
 	if (connect (fd, serv_addr, addrlen) == -1) {
-		struct pollfd fds;
+		mono_pollfd fds;
 		int so_error;
 		socklen_t len;
 		
@@ -344,7 +343,7 @@
 
 		fds.fd = fd;
 		fds.events = POLLOUT;
-		while (poll (&fds, 1, -1) == -1 &&
+		while (mono_poll (&fds, 1, -1) == -1 &&
 		       !_wapi_thread_cur_apc_pending ()) {
 			if (errno != EINTR) {
 				errnum = errno_to_WSA (errno, __func__);
Index: mono/utils/mono-poll.c
===================================================================
--- mono/utils/mono-poll.c	(revision 5128)
+++ mono/utils/mono-poll.c	(working copy)
@@ -1,7 +1,7 @@
 #include "mono-poll.h"
 #include <errno.h>
 
-#ifdef HAVE_POLL
+#if defined(HAVE_POLL) && !defined(__APPLE__)
 int
 mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout)
 {
