summaryrefslogtreecommitdiff
path: root/src/util/posix.h
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2023-05-13 17:11:56 +0100
committerGitHub <noreply@github.com>2023-05-13 17:11:56 +0100
commit9d41a3fd694d983ade53fb602a58f6df25ce0656 (patch)
tree73fb6759a3138023f85654e38dcac1fb9cc4c7ad /src/util/posix.h
parent905e4d19c2c401cef3964c2e28bf64b0dad77331 (diff)
parent8f695c806bac2b044f102c55b802e44f2d30ca01 (diff)
downloadlibgit2-9d41a3fd694d983ade53fb602a58f6df25ce0656.tar.gz
Merge pull request #6535 from libgit2/ethomson/timeouts
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