aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/alloc/locking_allocator/locking_allocator.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/alloc/locking_allocator/locking_allocator.cpp b/src/lib/alloc/locking_allocator/locking_allocator.cpp
index 6a9cc2579..ec294d8f0 100644
--- a/src/lib/alloc/locking_allocator/locking_allocator.cpp
+++ b/src/lib/alloc/locking_allocator/locking_allocator.cpp
@@ -26,7 +26,9 @@ const size_t ALIGNMENT_MULTIPLE = 2;
size_t reset_mlock_limit(size_t max_req)
{
+#if defined(RLIMIT_MEMLOCK)
struct rlimit limits;
+
::getrlimit(RLIMIT_MEMLOCK, &limits);
if(limits.rlim_cur < limits.rlim_max)
@@ -37,6 +39,9 @@ size_t reset_mlock_limit(size_t max_req)
}
return std::min<size_t>(limits.rlim_cur, max_req);
+#endif
+
+ return 0;
}
size_t mlock_limit()