Received: from eggs.gnu.org ([2001:4830:134:3::10]:34433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZI5RU-0004gV-IC for qemu-devel@nongnu.org; Wed, 22 Jul 2015 21:37:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZI5RR-0005Y9-Js for qemu-devel@nongnu.org; Wed, 22 Jul 2015 21:37:00 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:36878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZI5RR-0005Xk-CZ for qemu-devel@nongnu.org; Wed, 22 Jul 2015 21:36:57 -0400 Received: by wibud3 with SMTP id ud3so196907149wib.0 for ; Wed, 22 Jul 2015 18:36:56 -0700 (PDT) Sender: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 23 Jul 2015 03:36:38 +0200 Message-Id: <1437615403-13554-2-git-send-email-marcandre.lureau@redhat.com> In-Reply-To: <1437615403-13554-1-git-send-email-marcandre.lureau@redhat.com> References: <1437615403-13554-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH RFC 1/6] configure: probe for memfd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: thibaut.collet@6wind.com, pbonzini@redhat.com, haifeng.lin@huawei.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , mst@redhat.com Check if memfd_create() is part of system libc. Signed-off-by: Marc-André Lureau --- configure | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/configure b/configure index cc0338d..9a401d4 100755 --- a/configure +++ b/configure @@ -3390,6 +3390,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 @@ -4770,6 +4786,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 -- 2.4.3