]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
memfd: fix configure test
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 28 Nov 2017 10:51:27 +0000 (11:51 +0100)
committerAnthony PERARD <anthony.perard@citrix.com>
Fri, 29 Jun 2018 14:12:57 +0000 (15:12 +0100)
Recent glibc added memfd_create in sys/mman.h.  This conflicts with
the definition in util/memfd.c:

    /builddir/build/BUILD/qemu-2.11.0-rc1/util/memfd.c:40:12: error: static declaration of memfd_create follows non-static declaration

Fix the configure test, and remove the sys/memfd.h inclusion since the
file actually does not exist---it is a typo in the memfd_create(2) man
page.

Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 75e5b70e6b5dcc4f2219992d7cffa462aa406af0)

configure
util/memfd.c

index dd73cce62f9d3f86bc3095774fa3056adc45cd58..53581d787dac5ed9f7b1f601659e202f7e6458f9 100755 (executable)
--- a/configure
+++ b/configure
@@ -3855,7 +3855,7 @@ fi
 # check if memfd is supported
 memfd=no
 cat > $TMPC << EOF
-#include <sys/memfd.h>
+#include <sys/mman.h>
 
 int main(void)
 {
index 4571d1aba866a67de41721aa17e4f54e0df695ef..412e94a405fc97110c4f4ce2508a04d1a5ad5ab0 100644 (file)
@@ -31,9 +31,7 @@
 
 #include "qemu/memfd.h"
 
-#ifdef CONFIG_MEMFD
-#include <sys/memfd.h>
-#elif defined CONFIG_LINUX
+#if defined CONFIG_LINUX && !defined CONFIG_MEMFD
 #include <sys/syscall.h>
 #include <asm/unistd.h>