From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zgxrs-00027n-4T for qemu-devel@nongnu.org; Tue, 29 Sep 2015 12:35:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zgxrr-0003R4-40 for qemu-devel@nongnu.org; Tue, 29 Sep 2015 12:35:04 -0400 Received: from mail-qg0-x232.google.com ([2607:f8b0:400d:c04::232]:36820) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zgxrq-0003Qs-WB for qemu-devel@nongnu.org; Tue, 29 Sep 2015 12:35:03 -0400 Received: by qgx61 with SMTP id 61so10991749qgx.3 for ; Tue, 29 Sep 2015 09:35:02 -0700 (PDT) Sender: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= From: marcandre.lureau@redhat.com Date: Tue, 29 Sep 2015 18:34:32 +0200 Message-Id: <1443544494-28737-3-git-send-email-marcandre.lureau@redhat.com> In-Reply-To: <1443544494-28737-1-git-send-email-marcandre.lureau@redhat.com> References: <1443544494-28737-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 v6 02/24] 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 f14454e..5e77ed5 100755 --- a/configure +++ b/configure @@ -3486,6 +3486,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 @@ -4857,6 +4873,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