summaryrefslogtreecommitdiff
path: root/src/ppoll.h
diff options
context:
space:
mode:
authorAdrian Bunk <adrian.bunk@movial.com>2011-06-03 09:17:04 +0000
committerAdrian Bunk <adrian.bunk@movial.com>2011-06-03 09:17:04 +0000
commit799757ccf1d03c33c75bc597cd5ef77741dcb6a7 (patch)
treea8c3be85c730de28b012586591b76301033d3d21 /src/ppoll.h
Imported upstream 4.91upstream-4.91upstreampackaging
Diffstat (limited to 'src/ppoll.h')
-rw-r--r--src/ppoll.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ppoll.h b/src/ppoll.h
new file mode 100644
index 0000000..7d09d44
--- /dev/null
+++ b/src/ppoll.h
@@ -0,0 +1,16 @@
+#ifdef ppoll
+#undef ppoll
+#endif
+
+#define ppoll compat_ppoll
+
+static inline int compat_ppoll(struct pollfd *fds, nfds_t nfds,
+ const struct timespec *timeout, const sigset_t *sigmask)
+{
+ if (timeout == NULL)
+ return poll(fds, nfds, -1);
+ else if (timeout->tv_sec == 0)
+ return poll(fds, nfds, 500);
+ else
+ return poll(fds, nfds, timeout->tv_sec * 1000);
+}