X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=os-posix.c;h=d39261d84949243cfc407d93603eb4d66a0d0586;hb=9822261ce3bfbc7aec8b2a3e378892dc368910ed;hp=5c64518902583cfd90edaf87a57ac59749d0b9e9;hpb=27dd7730582be85c7d4f680f5f71146629809c86;p=qemu.git diff --git a/os-posix.c b/os-posix.c index 5c6451890..d39261d84 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; +}