diff options
author | Jack Lloyd <[email protected]> | 2022-04-05 11:24:05 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2022-04-05 11:24:05 -0400 |
commit | 1fa8bdefad6dcff17eb5a1f074ccb23a2b22ffa8 (patch) | |
tree | 2a4515f19726fe4d4280836ca45fbb138fb99db9 /src | |
parent | 17fe9c1e47cc1ecfc13d607a68f463c286f8f187 (diff) | |
parent | ee52ce30795a547bb4524e1166238ec44ef6e950 (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.cpp | 7 | ||||
-rw-r--r-- | src/lib/utils/os_utils.h | 2 |
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); |