From b073e110e81bc16d17d4d0bcc40f0137685bbf39 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 15 Mar 2013 13:15:43 +0000 Subject: 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 Acked-by: Ian Jackson --- tools/blktap2/drivers/libaio-compat.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tools/blktap2') 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 #include #include @@ -50,6 +51,16 @@ static inline void __io_set_eventfd(struct iocb *iocb, int eventfd) c->resfd = eventfd; } +#ifdef HAVE_SYS_EVENTFD_H + +#include + +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 */ -- cgit v1.2.3