summaryrefslogtreecommitdiffstats
path: root/osdep/poll_wrapper.h
diff options
context:
space:
mode:
Diffstat (limited to 'osdep/poll_wrapper.h')
-rw-r--r--osdep/poll_wrapper.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/osdep/poll_wrapper.h b/osdep/poll_wrapper.h
new file mode 100644
index 0000000..b359ed3
--- /dev/null
+++ b/osdep/poll_wrapper.h
@@ -0,0 +1,12 @@
+#pragma once
+
+#include <poll.h>
+#include <stdint.h>
+
+// Behaves like poll(3) but works for device files on macOS.
+// Only supports POLLIN and POLLOUT.
+int polldev(struct pollfd fds[], nfds_t nfds, int timeout);
+
+// Generic polling wrapper. It will try and use higher resolution
+// polling (ppoll) if available.
+int mp_poll(struct pollfd *fds, int nfds, int64_t timeout_ns);