X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fcompat%2Fwindows%2Fwincompat.h;h=f611e33e581534346e81022dafb3f83759c87084;hb=dd315fb0f7a90a6f154cbea0e7a7c64b550164b9;hp=de3396c2a62bc08665c9212812a1305d51636710;hpb=63561f9937d11b1371a2de2511b903035818b42f;p=catta diff --git a/src/compat/windows/wincompat.h b/src/compat/windows/wincompat.h index de3396c..f611e33 100644 --- a/src/compat/windows/wincompat.h +++ b/src/compat/windows/wincompat.h @@ -21,6 +21,10 @@ void winsock_init(void); void winsock_exit(void); +// the equivalent of strerror(errno) for Windows sockets +char *errnostrsocket(void); + + // Winsock doesn't have recvmsg/sendmsg but offers the same functionality // with WSARecvMsg/WSASendMsg, so we implement the former in terms of the // latter. @@ -95,6 +99,11 @@ int ioctl(int d, unsigned long request, int *p); // something to give to WSAPoll, so we fake it with a local TCP socket. (ugh) int pipe(int pipefd[2]); +// pipe(socket)-specific read/write/close equivalents +#define closepipe closesocket +#define writepipe(s,buf,len) send(s, buf, len, 0) +#define readpipe(s,buf,len) recv(s, buf, len, 0) + // Windows logically doesn't have uname, so we supply a replacement.