projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[coop] Add possibly unbalanced state switching functions
[mono.git]
/
mono
/
utils
/
mono-poll.c
diff --git
a/mono/utils/mono-poll.c
b/mono/utils/mono-poll.c
old mode 100644
(file)
new mode 100755
(executable)
index
4bd3f37
..
74d39ce
--- a/
mono/utils/mono-poll.c
+++ b/
mono/utils/mono-poll.c
@@
-1,7
+1,25
@@
+#include <config.h>
+
+#ifdef HOST_WIN32
+/* For select */
+#include <winsock2.h>
+#endif
+
#include "mono-poll.h"
#include <errno.h>
#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)
{
int
mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout)
{
@@
-36,7
+54,7
@@
mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout)
if (fd < 0)
continue;
if (fd < 0)
continue;
-#ifdef
PLATFORM
_WIN32
+#ifdef
HOST
_WIN32
if (nexc >= FD_SETSIZE) {
ufds [i].revents = MONO_POLLNVAL;
return 1;
if (nexc >= FD_SETSIZE) {
ufds [i].revents = MONO_POLLNVAL;
return 1;
@@
-64,7
+82,7
@@
mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout)
affected = select (maxfd + 1, &rfds, &wfds, &efds, tvptr);
if (affected == -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;
int error = WSAGetLastError ();
switch (error) {
case WSAEFAULT: errno = EFAULT; break;
@@
-114,3
+132,4
@@
mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout)
#endif
#endif
+#endif /* #ifndef DISABLE_SOCKETS */