aboutsummaryrefslogtreecommitdiff
path: root/os-posix.c
diff options
context:
space:
mode:
Diffstat (limited to 'os-posix.c')
-rw-r--r--os-posix.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/os-posix.c b/os-posix.c
index 5c64518902..d39261d849 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -363,3 +363,15 @@ bool is_daemonized(void)
{
return daemonize;
}
+
+int os_mlock(void)
+{
+ int ret = 0;
+
+ ret = mlockall(MCL_CURRENT | MCL_FUTURE);
+ if (ret < 0) {
+ perror("mlockall");
+ }
+
+ return ret;
+}