| 358 | } |
| 359 | |
| 360 | static const char *wstrerror(int err) { |
| 361 | switch (err) { |
| 362 | case WSAEINTR: return "Interrupted function call"; |
| 363 | case WSAEACCES: return "Permission denied"; |
| 364 | case WSAEFAULT: return "Bad address"; |
| 365 | case WSAEINVAL: return "Invalid argument"; |
| 366 | case WSAEMFILE: return "Too many open files"; |
| 367 | case WSAEWOULDBLOCK: return "Resource temporarily unavailable"; |
| 368 | case WSAEINPROGRESS: return "Operation now in progress"; |
| 369 | case WSAEALREADY: return "Operation already in progress"; |
| 370 | case WSAENOTSOCK: return "Socket operation on nonsocket"; |
| 371 | case WSAEDESTADDRREQ: return "Destination address required"; |
| 372 | case WSAEMSGSIZE: return "Message too long"; |
| 373 | case WSAEPROTOTYPE: return "Protocol wrong type for socket"; |
| 374 | case WSAENOPROTOOPT: return "Bad protocol option"; |
| 375 | case WSAEPROTONOSUPPORT: return "Protocol not supported"; |
| 376 | case WSAESOCKTNOSUPPORT: return "Socket type not supported"; |
| 377 | case WSAEOPNOTSUPP: return "Operation not supported"; |
| 378 | case WSAEPFNOSUPPORT: return "Protocol family not supported"; |
| 379 | case WSAEAFNOSUPPORT: |
| 380 | return "Address family not supported by protocol family"; |
| 381 | case WSAEADDRINUSE: return "Address already in use"; |
| 382 | case WSAEADDRNOTAVAIL: return "Cannot assign requested address"; |
| 383 | case WSAENETDOWN: return "Network is down"; |
| 384 | case WSAENETUNREACH: return "Network is unreachable"; |
| 385 | case WSAENETRESET: return "Network dropped connection on reset"; |
| 386 | case WSAECONNABORTED: return "Software caused connection abort"; |
| 387 | case WSAECONNRESET: return "Connection reset by peer"; |
| 388 | case WSAENOBUFS: return "No buffer space available"; |
| 389 | case WSAEISCONN: return "Socket is already connected"; |
| 390 | case WSAENOTCONN: return "Socket is not connected"; |
| 391 | case WSAESHUTDOWN: return "Cannot send after socket shutdown"; |
| 392 | case WSAETIMEDOUT: return "Connection timed out"; |
| 393 | case WSAECONNREFUSED: return "Connection refused"; |
| 394 | case WSAEHOSTDOWN: return "Host is down"; |
| 395 | case WSAEHOSTUNREACH: return "No route to host"; |
| 396 | case WSAEPROCLIM: return "Too many processes"; |
| 397 | case WSASYSNOTREADY: return "Network subsystem is unavailable"; |
| 398 | case WSAVERNOTSUPPORTED: return "Winsock.dll version out of range"; |
| 399 | case WSANOTINITIALISED: |
| 400 | return "Successful WSAStartup not yet performed"; |
| 401 | case WSAEDISCON: return "Graceful shutdown in progress"; |
| 402 | case WSAHOST_NOT_FOUND: return "Host not found"; |
| 403 | case WSATRY_AGAIN: return "Nonauthoritative host not found"; |
| 404 | case WSANO_RECOVERY: return "Nonrecoverable name lookup error"; |
| 405 | case WSANO_DATA: return "Valid name, no data record of requested type"; |
| 406 | default: return "Unknown error"; |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | const char *socket_gaistrerror(int err) { |
| 411 | if (err == 0) return NULL; |
no outgoing calls
no test coverage detected