aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2022-04-05 11:24:05 -0400
committerJack Lloyd <[email protected]>2022-04-05 11:24:05 -0400
commit1fa8bdefad6dcff17eb5a1f074ccb23a2b22ffa8 (patch)
tree2a4515f19726fe4d4280836ca45fbb138fb99db9 /src
parent17fe9c1e47cc1ecfc13d607a68f463c286f8f187 (diff)
parentee52ce30795a547bb4524e1166238ec44ef6e950 (diff)
Merge GH #2944 Use prctl to name mlock'ed blocks on Linux/Android (part 2)
Diffstat (limited to 'src')
-rw-r--r--src/lib/utils/os_utils.cpp7
-rw-r--r--src/lib/utils/os_utils.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/utils/os_utils.cpp b/src/lib/utils/os_utils.cpp
index 060de19a9..0f3c2dfdc 100644
--- a/src/lib/utils/os_utils.cpp
+++ b/src/lib/utils/os_utils.cpp
@@ -667,11 +667,12 @@ void OS::free_locked_pages(const std::vector<void*>& pages)
void OS::page_named(void* page, size_t size)
{
- constexpr char name[] = "Botan";
+ static constexpr char name[] = "Botan";
#if defined(BOTAN_TARGET_OS_HAS_PRCTL)
- (void)prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, reinterpret_cast<uintptr_t>(page), size, name);
+ int r = prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, reinterpret_cast<uintptr_t>(page), size, name);
+ BOTAN_UNUSED(r);
#else
- (void)name;
+ BOTAN_UNUSED(page, size);
#endif
}
diff --git a/src/lib/utils/os_utils.h b/src/lib/utils/os_utils.h
index 6550eea0d..62dfdeeaf 100644
--- a/src/lib/utils/os_utils.h
+++ b/src/lib/utils/os_utils.h
@@ -150,7 +150,7 @@ void page_prohibit_access(void* page);
void page_allow_access(void* page);
/**
-* Set a ID to a page's range
+* Set a ID to a page's range expressed by size bytes
*/
void page_named(void* page, size_t size);