summaryrefslogtreecommitdiffstats
path: root/common/ppoll.h
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-07-26 19:00:53 +0200
committerMarcel Holtmann <marcel@holtmann.org>2008-07-26 19:00:53 +0200
commitd6ae1c3f777832f8e32702f81fe64e33a1396928 (patch)
tree159a1e59f3929c9d795dbd1f3edd84d9dccba048 /common/ppoll.h
parentb8e5fea8d31fbcd3d1c044385f8217dbf39892bb (diff)
parent3382af9114a9b2e657c7ddd0a5511edda6a37a90 (diff)
Import bluez-utils-3.36 revision history
Diffstat (limited to 'common/ppoll.h')
-rw-r--r--common/ppoll.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/common/ppoll.h b/common/ppoll.h
new file mode 100644
index 00000000..7d09d44d
--- /dev/null
+++ b/common/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);
+}