about summary refs log tree commit diff
path: root/src/linux/eventfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/linux/eventfd.c')
-rw-r--r--src/linux/eventfd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/linux/eventfd.c b/src/linux/eventfd.c
index 53066487..39968034 100644
--- a/src/linux/eventfd.c
+++ b/src/linux/eventfd.c
@@ -4,7 +4,11 @@
 
 int eventfd(unsigned int count, int flags)
 {
-	return syscall(flags ? SYS_eventfd2 : SYS_eventfd, count, flags);
+	int r = __syscall(SYS_eventfd2, count, flags);
+#ifdef SYS_eventfd
+	if (r==-ENOSYS && !flags) r = __syscall(SYS_eventfd, count);
+#endif
+	return __syscall_ret(r);
 }
 
 int eventfd_read(int fd, eventfd_t *value)