summaryrefslogtreecommitdiff
path: root/src/util/posix.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/posix.h')
-rw-r--r--src/util/posix.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/util/posix.h b/src/util/posix.h
index 607aa9dce..74707453a 100644
--- a/src/util/posix.h
+++ b/src/util/posix.h
@@ -195,4 +195,26 @@ extern const char *p_gai_strerror(int ret);
# define p_gai_strerror(c) gai_strerror(c)
#endif /* NO_ADDRINFO */
+#ifdef GIT_IO_POLL
+# include <poll.h>
+# define p_poll poll
+#elif GIT_IO_WSAPOLL
+# include <winsock2.h>
+# define p_poll WSAPoll
+#else
+# define POLLIN 0x01
+# define POLLPRI 0x02
+# define POLLOUT 0x04
+# define POLLERR 0x08
+# define POLLHUP 0x10
+
+struct pollfd {
+ int fd;
+ short events;
+ short revents;
+};
+
+extern int p_poll(struct pollfd *fds, unsigned int nfds, int timeout);
+#endif
+
#endif