diff options
author | Thomas Haller <thaller@redhat.com> | 2018-09-11 16:06:25 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-10-25 16:37:35 +0200 |
commit | 50e092a967e3e8baac75dd09f69ec2a94f70f889 (patch) | |
tree | 16e5812635fa757688e36e892f1aede9d59bb5aa | |
parent | ec37e18c64ac480fc7c7699e45005894c27c8416 (diff) | |
download | NetworkManager-50e092a967e3e8baac75dd09f69ec2a94f70f889.tar.gz |
build: add configure check for having memfd_create() API
-rw-r--r-- | config.h.meson | 4 | ||||
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | meson.build | 1 |
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>')) |