aboutsummaryrefslogtreecommitdiffstats
path: root/tools/blktap2
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2013-03-15 13:15:43 +0000
committerIan Campbell <ian.campbell@citrix.com>2013-04-11 11:09:25 +0100
commitb073e110e81bc16d17d4d0bcc40f0137685bbf39 (patch)
treec20e05cfeaca7728a9a80883bd5fcf1951460953 /tools/blktap2
parent1cc48e865b2faa3f8147c15fcec4c24c46b3d63f (diff)
downloadxen-b073e110e81bc16d17d4d0bcc40f0137685bbf39.tar.gz
xen-b073e110e81bc16d17d4d0bcc40f0137685bbf39.tar.bz2
xen-b073e110e81bc16d17d4d0bcc40f0137685bbf39.zip
blktap2: use sys/eventfd.h if it is available
arm64 only has the eventfd2 system call and using the libc wrapper when available hides this from us. eventfd() has been in libc since glibc 2.8. This code is already Linux specific. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/blktap2')
-rw-r--r--tools/blktap2/drivers/libaio-compat.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/blktap2/drivers/libaio-compat.h b/tools/blktap2/drivers/libaio-compat.h
index 353c36a869..47cd96de94 100644
--- a/tools/blktap2/drivers/libaio-compat.h
+++ b/tools/blktap2/drivers/libaio-compat.h
@@ -29,6 +29,7 @@
#ifndef __LIBAIO_COMPAT
#define __LIBAIO_COMPAT
+#include "../../config.h"
#include <libaio.h>
#include <unistd.h>
#include <sys/syscall.h>
@@ -50,6 +51,16 @@ static inline void __io_set_eventfd(struct iocb *iocb, int eventfd)
c->resfd = eventfd;
}
+#ifdef HAVE_SYS_EVENTFD_H
+
+#include <sys/eventfd.h>
+
+static inline int tapdisk_sys_eventfd(int initval)
+{
+ return eventfd(initval, 0);
+}
+
+#else /* Fallback */
#ifndef SYS_eventfd
#ifndef __NR_eventfd
# if defined(__alpha__)
@@ -88,5 +99,6 @@ static inline int tapdisk_sys_eventfd(int initval)
{
return syscall(SYS_eventfd, initval, 0);
}
+#endif
#endif /* __LIBAIO_COMPAT */