aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--event.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/event.c b/event.c
index 6398b7d..10919e4 100644
--- a/event.c
+++ b/event.c
@@ -123,7 +123,11 @@ int event_process(const struct timespec *timeout)
j++;
}
}
+#if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 4)
int ready = ppoll(fds, j, timeout, NULL);
+#else
+ int ready = poll(fds, j, timeout->tv_sec * 1000000 + timeout->tv_nsec / 1000000);
+#endif
if (ready > 0) {
//search the file descriptors, call all relavant callbacks