From 50e092a967e3e8baac75dd09f69ec2a94f70f889 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 11 Sep 2018 16:06:25 +0200 Subject: [PATCH] build: add configure check for having memfd_create() API --- config.h.meson | 4 ++++ configure.ac | 6 ++++++ meson.build | 1 + 3 files changed, 11 insertions(+) diff --git a/config.h.meson b/config.h.meson index e79f9dcb5..c8f980552 100644 --- a/config.h.meson +++ b/config.h.meson @@ -19,6 +19,10 @@ /* Gettext package */ #mesondefine GETTEXT_PACKAGE +/* Define to 1 if you have the declaration of `memfd_create', and to 0 if you + don't. */ +#mesondefine HAVE_DECL_MEMFD_CREATE + /* Define to 1 if you have the declaration of `reallocarray', and to 0 if you don't. */ #mesondefine HAVE_DECL_REALLOCARRAY diff --git a/configure.ac b/configure.ac index 946f6b35e..aac2a3234 100644 --- a/configure.ac +++ b/configure.ac @@ -81,6 +81,12 @@ AC_CHECK_DECLS([ #include ]]) +AC_CHECK_DECLS([ + memfd_create], + [], [], [[ +#include +]]) + AC_CHECK_HEADERS(sys/auxv.h) AC_CHECK_DECLS([getrandom], diff --git a/meson.build b/meson.build index c7c0bfc58..9bfc6bb3e 100644 --- a/meson.build +++ b/meson.build @@ -115,6 +115,7 @@ config_h.set('HAVE_SECURE_GETENV', cc.has_function('secure_getenv')) config_h.set('HAVE___SECURE_GETENV', cc.has_function('__secure_getenv')) config_h.set10('HAVE_DECL_REALLOCARRAY', cc.has_function('reallocarray', prefix: '#include ')) config_h.set10('HAVE_DECL_EXPLICIT_BZERO', cc.has_function('explicit_bzero', prefix: '#include ')) +config_h.set10('HAVE_DECL_MEMFD_CREATE', cc.has_function('memfd_create', prefix: '#include ')) # types config_h.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix: '#include '))