Commit 50e092a9 authored by Thomas Haller's avatar Thomas Haller

build: add configure check for having memfd_create() API

parent ec37e18c
......@@ -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
......
......@@ -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],
......
......@@ -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>'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment