Received: from eggs.gnu.org ([2001:4830:134:3::10]:33987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZdF8D-0000mm-32 for qemu-devel@nongnu.org; Sat, 19 Sep 2015 06:12:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZdF8C-0005Jl-8J for qemu-devel@nongnu.org; Sat, 19 Sep 2015 06:12:32 -0400 Received: from mail-qg0-x232.google.com ([2607:f8b0:400d:c04::232]:33946) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZdF8C-0005JR-4b for qemu-devel@nongnu.org; Sat, 19 Sep 2015 06:12:32 -0400 Received: by qgez77 with SMTP id z77so57418282qge.1 for ; Sat, 19 Sep 2015 03:12:31 -0700 (PDT) Sender: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= From: marcandre.lureau@redhat.com Date: Sat, 19 Sep 2015 12:11:55 +0200 Message-Id: <1442657533-13030-5-git-send-email-marcandre.lureau@redhat.com> In-Reply-To: <1442657533-13030-1-git-send-email-marcandre.lureau@redhat.com> References: <1442657533-13030-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 v4 04/22] 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