From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcJcI-0000df-0E for qemu-devel@nongnu.org; Thu, 30 Jun 2011 11:57:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QcJcG-00004q-CS for qemu-devel@nongnu.org; Thu, 30 Jun 2011 11:57:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcJcF-0008Sz-Ns for qemu-devel@nongnu.org; Thu, 30 Jun 2011 11:57:20 -0400 Date: Thu, 30 Jun 2011 18:57:26 +0300 From: "Michael S. Tsirkin" Message-ID: <20110630155725.GA9765@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCHv2] Add compat eventfd header List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , Paolo Bonzini , Stefan Hajnoczi , Aurelien Jarno , Alexander Graf Support build on rhel 5.X where we have syscall for eventfd but not userspace wrapper. (cherry-picked from commit 9e3269181e9bc56feb43bcd4e8ce0b82cd543e65 in qemu-kvm.git). Signed-off-by: Michael S. Tsirkin --- Changes from v1: checkpatch fix address comments by agraf verify we are on linux compat/sys/eventfd.h | 20 ++++++++++++++++++++ configure | 6 ++++-- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 compat/sys/eventfd.h diff --git a/compat/sys/eventfd.h b/compat/sys/eventfd.h new file mode 100644 index 0000000..1801a5f --- /dev/null +++ b/compat/sys/eventfd.h @@ -0,0 +1,20 @@ +#ifndef _COMPAT_SYS_EVENTFD +#define _COMPAT_SYS_EVENTFD + +#ifdef CONFIG_EVENTFD + +#ifndef __linux__ +#error __linux__ is not defined: eventfd is only supported on linux +#endif + +#include +#include + +static inline int eventfd(int count, int flags) +{ + return syscall(SYS_eventfd, count, flags); +} + +#endif + +#endif diff --git a/configure b/configure index 856b41e..6f7dd74 100755 --- a/configure +++ b/configure @@ -822,7 +822,6 @@ esac [ -z "$guest_base" ] && guest_base="$host_guest_base" - default_target_list="" # these targets are portable @@ -891,6 +890,9 @@ sparc64-bsd-user \ " fi +#compat headers +QEMU_CFLAGS="$QEMU_CFLAGS -idirafter $source_path/compat" + if test x"$show_help" = x"yes" ; then cat << EOF @@ -2122,7 +2124,7 @@ int main(void) return 0; } EOF -if compile_prog "" "" ; then +if compile_prog "-DCONFIG_EVENTFD" "" ; then eventfd=yes fi -- 1.7.5.53.gc233e