[gtk/ebassi/secure-buffer: 2/5] Check for mlock()
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/ebassi/secure-buffer: 2/5] Check for mlock()
- Date: Tue, 8 Sep 2020 17:19:13 +0000 (UTC)
commit e4ee5618aa066ec1976b7591782d941ae46ec170
Author: Emmanuele Bassi <ebassi gnome org>
Date: Tue Sep 8 17:50:39 2020 +0100
Check for mlock()
We use it in the secure memory allocator, if it's available.
config.h.meson | 3 +++
meson.build | 5 +++++
2 files changed, 8 insertions(+)
---
diff --git a/config.h.meson b/config.h.meson
index f6a0ea0187..1968bb9cbe 100644
--- a/config.h.meson
+++ b/config.h.meson
@@ -69,6 +69,9 @@
/* Define to 1 if you have the `mkstemp' function. */
#mesondefine HAVE_MKSTEMP
+/* Define to 1 if you have the `mlock` function. */
+#mesondefine HAVE_MLOCK
+
/* Define to 1 if you have a working `mmap' system call. */
#mesondefine HAVE_MMAP
diff --git a/meson.build b/meson.build
index 88b3e7c0d5..aa1b6e5c77 100644
--- a/meson.build
+++ b/meson.build
@@ -217,6 +217,11 @@ if cc.compiles(uint128_t_src, name : '__uint128_t available')
cdata.set('HAVE_UINT128_T', 1)
endif
+# Check for mlock
+if cc.has_function('mlock', prefix: '#include <sys/mman.h>')
+ cdata.set('HAVE_MLOCK', 1)
+endif
+
# Disable deprecation checks for all libraries we depend on on stable branches.
# This is so newer versions of those libraries don't cause more warnings with
# a stable GTK version.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]