static int winsock_error_to_errno()

in compat/mingw.c [2368:2465]


static int winsock_error_to_errno(DWORD err)
{
	switch (err) {
	case WSAEINTR: return EINTR;
	case WSAEBADF: return EBADF;
	case WSAEACCES: return EACCES;
	case WSAEFAULT: return EFAULT;
	case WSAEINVAL: return EINVAL;
	case WSAEMFILE: return EMFILE;
	case WSAEWOULDBLOCK: return EWOULDBLOCK;
	case WSAEINPROGRESS: return EINPROGRESS;
	case WSAEALREADY: return EALREADY;
	case WSAENOTSOCK: return ENOTSOCK;
	case WSAEDESTADDRREQ: return EDESTADDRREQ;
	case WSAEMSGSIZE: return EMSGSIZE;
	case WSAEPROTOTYPE: return EPROTOTYPE;
	case WSAENOPROTOOPT: return ENOPROTOOPT;
	case WSAEPROTONOSUPPORT: return EPROTONOSUPPORT;
	case WSAEOPNOTSUPP: return EOPNOTSUPP;
	case WSAEAFNOSUPPORT: return EAFNOSUPPORT;
	case WSAEADDRINUSE: return EADDRINUSE;
	case WSAEADDRNOTAVAIL: return EADDRNOTAVAIL;
	case WSAENETDOWN: return ENETDOWN;
	case WSAENETUNREACH: return ENETUNREACH;
	case WSAENETRESET: return ENETRESET;
	case WSAECONNABORTED: return ECONNABORTED;
	case WSAECONNRESET: return ECONNRESET;
	case WSAENOBUFS: return ENOBUFS;
	case WSAEISCONN: return EISCONN;
	case WSAENOTCONN: return ENOTCONN;
	case WSAETIMEDOUT: return ETIMEDOUT;
	case WSAECONNREFUSED: return ECONNREFUSED;
	case WSAELOOP: return ELOOP;
	case WSAENAMETOOLONG: return ENAMETOOLONG;
	case WSAEHOSTUNREACH: return EHOSTUNREACH;
	case WSAENOTEMPTY: return ENOTEMPTY;
	/* No errno equivalent; default to EIO */
	case WSAESOCKTNOSUPPORT:
	case WSAEPFNOSUPPORT:
	case WSAESHUTDOWN:
	case WSAETOOMANYREFS:
	case WSAEHOSTDOWN:
	case WSAEPROCLIM:
	case WSAEUSERS:
	case WSAEDQUOT:
	case WSAESTALE:
	case WSAEREMOTE:
	case WSASYSNOTREADY:
	case WSAVERNOTSUPPORTED:
	case WSANOTINITIALISED:
	case WSAEDISCON:
	case WSAENOMORE:
	case WSAECANCELLED:
	case WSAEINVALIDPROCTABLE:
	case WSAEINVALIDPROVIDER:
	case WSAEPROVIDERFAILEDINIT:
	case WSASYSCALLFAILURE:
	case WSASERVICE_NOT_FOUND:
	case WSATYPE_NOT_FOUND:
	case WSA_E_NO_MORE:
	case WSA_E_CANCELLED:
	case WSAEREFUSED:
	case WSAHOST_NOT_FOUND:
	case WSATRY_AGAIN:
	case WSANO_RECOVERY:
	case WSANO_DATA:
	case WSA_QOS_RECEIVERS:
	case WSA_QOS_SENDERS:
	case WSA_QOS_NO_SENDERS:
	case WSA_QOS_NO_RECEIVERS:
	case WSA_QOS_REQUEST_CONFIRMED:
	case WSA_QOS_ADMISSION_FAILURE:
	case WSA_QOS_POLICY_FAILURE:
	case WSA_QOS_BAD_STYLE:
	case WSA_QOS_BAD_OBJECT:
	case WSA_QOS_TRAFFIC_CTRL_ERROR:
	case WSA_QOS_GENERIC_ERROR:
	case WSA_QOS_ESERVICETYPE:
	case WSA_QOS_EFLOWSPEC:
	case WSA_QOS_EPROVSPECBUF:
	case WSA_QOS_EFILTERSTYLE:
	case WSA_QOS_EFILTERTYPE:
	case WSA_QOS_EFILTERCOUNT:
	case WSA_QOS_EOBJLENGTH:
	case WSA_QOS_EFLOWCOUNT:
#ifndef _MSC_VER
	case WSA_QOS_EUNKNOWNPSOBJ:
#endif
	case WSA_QOS_EPOLICYOBJ:
	case WSA_QOS_EFLOWDESC:
	case WSA_QOS_EPSFLOWSPEC:
	case WSA_QOS_EPSFILTERSPEC:
	case WSA_QOS_ESDMODEOBJ:
	case WSA_QOS_ESHAPERATEOBJ:
	case WSA_QOS_RESERVED_PETYPE:
	default: return EIO;
	}
}