X-Git-Url: http://git.meshlink.io/?p=catta;a=blobdiff_plain;f=src%2Fcompat%2Fwindows%2Fwincompat.c;h=3e6417ef2d2115acf87b3fdc6640938393c076c3;hp=4e3145e6e672c73bee5d40d9af5bdaf4c6f4f86b;hb=4ac8d5e93bf09c86e8352cdc2099b35ec89ba3a9;hpb=f502ad7eec6117b80c415b0c6ed45989afab5aaa diff --git a/src/compat/windows/wincompat.c b/src/compat/windows/wincompat.c index 4e3145e..3e6417e 100644 --- a/src/compat/windows/wincompat.c +++ b/src/compat/windows/wincompat.c @@ -46,6 +46,16 @@ void winsock_exit(void) catta_log_warn("WSACleanup() failed: %d", WSAGetLastError()); } +char *errnostrsocket(void) +{ + static char buf[256]; + + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, WSAGetLastError(), 0, buf, sizeof(buf), NULL); + + return buf; +} + ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags) { LPFN_WSARECVMSG WSARecvMsg = NULL;