summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-09-11 16:06:25 +0200
committerThomas Haller <thaller@redhat.com>2018-10-23 16:45:45 +0200
commit2f5743a473f292d58c6b46283dc97cf78bca45d1 (patch)
treeb9c5cd016e1dadfe012c102bb0f085ec26f8d399
parent05d6c993dd0cee474540f74902d213d084a86782 (diff)
downloadNetworkManager-2f5743a473f292d58c6b46283dc97cf78bca45d1.tar.gz
build: add configure check for having memfd_create() API
-rw-r--r--config.h.meson4
-rw-r--r--configure.ac6
-rw-r--r--meson.build1
3 files changed, 11 insertions, 0 deletions
diff --git a/config.h.meson b/config.h.meson
index e79f9dcb54..c8f9805526 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 946f6b35e5..aac2a32340 100644
--- a/configure.ac
+++ b/configure.ac
@@ -81,6 +81,12 @@ AC_CHECK_DECLS([
#include <malloc.h>
]])
+AC_CHECK_DECLS([
+ memfd_create],
+ [], [], [[
+#include <sys/mman.h>
+]])
+
AC_CHECK_HEADERS(sys/auxv.h)
AC_CHECK_DECLS([getrandom],
diff --git a/meson.build b/meson.build
index c7c0bfc589..9bfc6bb3ee 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 <malloc.h>'))
config_h.set10('HAVE_DECL_EXPLICIT_BZERO', cc.has_function('explicit_bzero', prefix: '#include <string.h>'))
+config_h.set10('HAVE_DECL_MEMFD_CREATE', cc.has_function('memfd_create', prefix: '#include <sys/mman.h>'))
# types
config_h.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix: '#include <sys/types.h>'))