]> git.meshlink.io Git - catta/blobdiff - src/compat/windows/wincompat.h
add an alias for poll and implement pipe in terms of sockets
[catta] / src / compat / windows / wincompat.h
index b5020226a8e5465ea406bc56105e3d61a7fdd0c9..c736f75f938dc03868c75accbad1354239e21d37 100644 (file)
@@ -83,6 +83,14 @@ ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags);
 int ioctl(int d, unsigned long request, int *p);
 
 
+// Windows lacks poll, but WSAPoll is good enough for us.
+#define poll(fds, nfds, timeout) WSAPoll(fds, nfds, timeout)
+
+// Windows lacks pipe. It has an equivalent CreatePipe but we really need
+// something to give to WSAPoll, so we fake it with a local TCP socket. (ugh)
+int pipe(int pipefd[2]);
+
+
 // Windows logically doesn't have uname, so we supply a replacement.
 
 struct utsname {