From e76fadf93e4d64492206b34fd3d434b515450d2c Mon Sep 17 00:00:00 2001 From: Daniil Tatianin Date: Wed, 12 Feb 2025 17:39:17 +0300 Subject: os: add an ability to lock memory on_fault This will be used in the following commits to make it possible to only lock memory on fault instead of right away. Signed-off-by: Daniil Tatianin Reviewed-by: Vladimir Sementsov-Ogievskiy Link: https://lore.kernel.org/r/20250212143920.1269754-2-d-tatianin@yandex-team.ru [peterx: fail os_mlock(on_fault=1) when not supported] [peterx: use G_GNUC_UNUSED instead of "(void)on_fault", per Dan] Signed-off-by: Peter Xu --- include/system/os-posix.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/system/os-posix.h') diff --git a/include/system/os-posix.h b/include/system/os-posix.h index b881ac6c6f..ce5b3bccf8 100644 --- a/include/system/os-posix.h +++ b/include/system/os-posix.h @@ -53,7 +53,7 @@ bool os_set_runas(const char *user_id); void os_set_chroot(const char *path); void os_setup_limits(void); void os_setup_post(void); -int os_mlock(void); +int os_mlock(bool on_fault); /** * qemu_alloc_stack: -- cgit 1.4.1