gint
mono_w32socket_set_blocking (SOCKET socket, gboolean blocking)
{
+#ifdef O_NONBLOCK
gint ret;
gpointer handle;
return SOCKET_ERROR;
}
-#ifdef O_NONBLOCK
/* This works better than ioctl(...FIONBIO...)
* on Linux (it causes connect to return
* EINPROGRESS, but the ioctl doesn't seem to) */
ret = fcntl (socket, F_GETFL, 0);
if (ret != -1)
ret = fcntl (socket, F_SETFL, blocking ? (ret & (~O_NONBLOCK)) : (ret | (O_NONBLOCK)));
-#endif /* O_NONBLOCK */
if (ret == -1) {
gint errnum = errno;
}
return 0;
+#else
+ mono_w32socket_set_last_error (ERROR_NOT_SUPPORTED);
+ return SOCKET_ERROR;
+#endif /* O_NONBLOCK */
}
gint