]> git.meshlink.io Git - catta/blobdiff - src/compat/windows/wincompat.h
readpipe/writepite/closepipe for fake pipes on Windows
[catta] / src / compat / windows / wincompat.h
index 8f62240c68be2e3cc9f9c57bfc1b98f283d503a2..f611e33e581534346e81022dafb3f83759c87084 100644 (file)
@@ -99,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.