diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2013-03-15 13:15:43 +0000 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2013-04-11 11:09:25 +0100 |
commit | b073e110e81bc16d17d4d0bcc40f0137685bbf39 (patch) | |
tree | c20e05cfeaca7728a9a80883bd5fcf1951460953 /tools/blktap2 | |
parent | 1cc48e865b2faa3f8147c15fcec4c24c46b3d63f (diff) | |
download | xen-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.h | 12 |
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 */ |