summaryrefslogtreecommitdiffstats
path: root/osdep/poll_wrapper.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:36:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:36:56 +0000
commit51de1d8436100f725f3576aefa24a2bd2057bc28 (patch)
treec6d1d5264b6d40a8d7ca34129f36b7d61e188af3 /osdep/poll_wrapper.h
parentInitial commit. (diff)
downloadmpv-51de1d8436100f725f3576aefa24a2bd2057bc28.tar.xz
mpv-51de1d8436100f725f3576aefa24a2bd2057bc28.zip
Adding upstream version 0.37.0.upstream/0.37.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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);