diff options
author | Daniil Tatianin <d-tatianin@yandex-team.ru> | 2025-02-12 17:39:17 +0300 |
---|---|---|
committer | Peter Xu <peterx@redhat.com> | 2025-02-12 11:36:01 -0500 |
commit | e76fadf93e4d64492206b34fd3d434b515450d2c (patch) | |
tree | 94f81ba80646b20415d05b311901eb91b7f8e979 /include | |
parent | 30943e496f2b0a49357581af480bdcd74fb338f5 (diff) | |
download | qemu-e76fadf93e4d64492206b34fd3d434b515450d2c.zip qemu-e76fadf93e4d64492206b34fd3d434b515450d2c.tar.gz qemu-e76fadf93e4d64492206b34fd3d434b515450d2c.tar.bz2 |
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 <d-tatianin@yandex-team.ru>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
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 <peterx@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/system/os-posix.h | 2 | ||||
-rw-r--r-- | include/system/os-win32.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/system/os-posix.h b/include/system/os-posix.h index b881ac6..ce5b3bc 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: diff --git a/include/system/os-win32.h b/include/system/os-win32.h index b82a5d3..bc62306 100644 --- a/include/system/os-win32.h +++ b/include/system/os-win32.h @@ -123,7 +123,7 @@ static inline bool is_daemonized(void) return false; } -static inline int os_mlock(void) +static inline int os_mlock(bool on_fault G_GNUC_UNUSED) { return -ENOSYS; } |