X-Git-Url: https://repo.jachan.dev/qemu.git/blobdiff_plain/6b2f90fbbd31d594238098f46ef63ee307a12f55..2575fe16d257a1fb5f452391b868b3c3263a9aca:/os-posix.c diff --git a/os-posix.c b/os-posix.c index f855abb09a..d39261d849 100644 --- a/os-posix.c +++ b/os-posix.c @@ -36,7 +36,7 @@ /* Needed early for CONFIG_BSD etc. */ #include "config-host.h" -#include "sysemu.h" +#include "sysemu/sysemu.h" #include "net/slirp.h" #include "qemu-options.h" @@ -193,7 +193,6 @@ void os_parse_cmd_args(int index, const char *optarg) break; #endif } - return; } static void change_process_uid(void) @@ -364,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; +}