aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils/os_utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/utils/os_utils.cpp')
-rw-r--r--src/lib/utils/os_utils.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/utils/os_utils.cpp b/src/lib/utils/os_utils.cpp
index 7d50dac77..86e5443c3 100644
--- a/src/lib/utils/os_utils.cpp
+++ b/src/lib/utils/os_utils.cpp
@@ -216,20 +216,21 @@ uint64_t OS::get_system_timestamp_ns()
size_t OS::system_page_size()
{
+ const size_t default_page_size = 4096;
+
#if defined(BOTAN_TARGET_OS_HAS_POSIX1)
long p = ::sysconf(_SC_PAGESIZE);
if(p > 1)
return static_cast<size_t>(p);
else
- return 4096;
+ return default_page_size;
#elif defined(BOTAN_TARGET_OS_HAS_VIRTUAL_LOCK)
SYSTEM_INFO sys_info;
::GetSystemInfo(&sys_info);
return sys_info.dwPageSize;
+#else
+ return default_page_size;
#endif
-
- // default value
- return 4096;
}
size_t OS::get_memory_locking_limit()