From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zf9Hx-0000Gz-Pw for qemu-devel@nongnu.org; Thu, 24 Sep 2015 12:22:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zf9Hx-00055M-3i for qemu-devel@nongnu.org; Thu, 24 Sep 2015 12:22:29 -0400 Received: from mail-qk0-x22b.google.com ([2607:f8b0:400d:c09::22b]:34099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zf9Hx-00055F-0L for qemu-devel@nongnu.org; Thu, 24 Sep 2015 12:22:29 -0400 Received: by qkfq186 with SMTP id q186so31683162qkf.1 for ; Thu, 24 Sep 2015 09:22:28 -0700 (PDT) Sender: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= From: marcandre.lureau@redhat.com Date: Thu, 24 Sep 2015 18:22:02 +0200 Message-Id: <1443111741-4736-3-git-send-email-marcandre.lureau@redhat.com> In-Reply-To: <1443111741-4736-1-git-send-email-marcandre.lureau@redhat.com> References: <1443111741-4736-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 v5 02/21] configure: probe for memfd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: haifeng.lin@huawei.com, mst@redhat.com, thibaut.collet@6wind.com, jasowang@redhat.com, pbonzini@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-André Lureau 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 52f5b79..a7cdfa4 100755 --- a/configure +++ b/configure @@ -3455,6 +3455,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 @@ -4840,6 +4856,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