From: Marc-André Lureau Date: Fri, 9 Oct 2015 15:17:16 +0000 (+0200) Subject: configure: probe for memfd X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=751bcc3981d80594a3943166401af15b76781a5b;p=qemu.git configure: probe for memfd Check if memfd_create() is part of system libc. Signed-off-by: Marc-André Lureau Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Tested-by: Thibaut Collet --- diff --git a/configure b/configure index f08327e10e..7b5fcd220c 100755 --- a/configure +++ b/configure @@ -3495,6 +3495,22 @@ if compile_prog "" "" ; then eventfd=yes fi +# check if memfd is supported +memfd=no +cat > $TMPC << EOF +#include + +int main(void) +{ + return memfd_create("foo", MFD_ALLOW_SEALING); +} +EOF +if compile_prog "" "" ; then + memfd=yes +fi + + + # check for fallocate fallocate=no cat > $TMPC << EOF @@ -4889,6 +4905,9 @@ fi if test "$eventfd" = "yes" ; then echo "CONFIG_EVENTFD=y" >> $config_host_mak fi +if test "$memfd" = "yes" ; then + echo "CONFIG_MEMFD=y" >> $config_host_mak +fi if test "$fallocate" = "yes" ; then echo "CONFIG_FALLOCATE=y" >> $config_host_mak fi