[w32error] Add ENXIO error case (#5199)
[mono.git] / mono / metadata / w32socket-unix.c
index 70b36ed2fa36feb4b22bd3579f3dc6e551a35207..5816b142b051e09e6c784e93518bbd9241dbd643 100644 (file)
@@ -12,6 +12,7 @@
 #include <pthread.h>
 #include <string.h>
 #include <stdlib.h>
+#include <sys/types.h>
 #include <sys/socket.h>
 #ifdef HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
@@ -27,7 +28,6 @@
 #endif
 #include <errno.h>
 #include <fcntl.h>
-#include <sys/types.h>
 #ifdef HAVE_SYS_UIO_H
 #include <sys/uio.h>
 #endif
@@ -1324,6 +1324,9 @@ mono_w32socket_convert_error (gint error)
        case ENODEV: return WSAENETDOWN;
 #ifdef EPROTOTYPE
        case EPROTOTYPE: return WSAEPROTOTYPE;
+#endif
+#ifdef ENXIO
+       case ENXIO: return WSAENXIO;
 #endif
        default:
                g_error ("%s: no translation into winsock error for (%d) \"%s\"", __func__, error, g_strerror (error));
@@ -1331,8 +1334,9 @@ mono_w32socket_convert_error (gint error)
 }
 
 gboolean
-ves_icall_System_Net_Sockets_Socket_SupportPortReuse (MonoProtocolType proto)
+ves_icall_System_Net_Sockets_Socket_SupportPortReuse (MonoProtocolType proto, MonoError *error)
 {
+       error_init (error);
 #if defined (SO_REUSEPORT)
        return TRUE;
 #else