From ba418132cd04865d444f4da2b5553e4d83b18138 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sat, 9 Dec 2017 09:41:09 -0500 Subject: osdep: add poll shim for macOS This implements a poll-compatible interface, backed by select on macOS, suitable for polling on device files - which are not supported by macOS's implementation of poll. This is a (long-standing) bug in macOS, so hopefully we can eventually remove this shim. --- osdep/polldev.h | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 osdep/polldev.h (limited to 'osdep/polldev.h') diff --git a/osdep/polldev.h b/osdep/polldev.h new file mode 100644 index 0000000000..50b6db29bc --- /dev/null +++ b/osdep/polldev.h @@ -0,0 +1,7 @@ +#pragma once + +#include + +// Behaves like poll(3) but works for device files on macOS. +// Only supports POLLIN, POLLOUT, and POLLERR. +int polldev(struct pollfd fds[], nfds_t nfds, int timeout); -- cgit v1.2.3