From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNKTl-0001oi-DD for qemu-devel@nongnu.org; Thu, 06 Aug 2015 08:41:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNKTj-0008GP-4x for qemu-devel@nongnu.org; Thu, 06 Aug 2015 08:41:01 -0400 Received: from mail-qg0-x22e.google.com ([2607:f8b0:400d:c04::22e]:34596) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNKTj-0008GB-1Z for qemu-devel@nongnu.org; Thu, 06 Aug 2015 08:40:59 -0400 Received: by qgeg42 with SMTP id g42so14671955qge.1 for ; Thu, 06 Aug 2015 05:40:58 -0700 (PDT) Sender: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= From: marcandre.lureau@redhat.com Date: Thu, 6 Aug 2015 14:40:37 +0200 Message-Id: <1438864852-4939-2-git-send-email-marcandre.lureau@redhat.com> In-Reply-To: <1438864852-4939-1-git-send-email-marcandre.lureau@redhat.com> References: <1438864852-4939-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 v3 01/16] 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 cd219d8..3dcbd3e 100755 --- a/configure +++ b/configure @@ -3405,6 +3405,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 @@ -4785,6 +4801,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