MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / mlock

Method mlock

devices/src/pvmemcontrol.rs:460–465  ·  view source on GitHub ↗
(&self, addr: u64, length: u64, on_default: bool)

Source from the content-addressed store, hash-verified

458 }
459
460 fn mlock(&self, addr: u64, length: u64, on_default: bool) -> result::Result<(), Error> {
461 // SAFETY: [`base`, `base` + `len`) is guest memory
462 self.operate_on_memory_range(addr, length, |base, len| unsafe {
463 libc::mlock2(base, len, if on_default { libc::MLOCK_ONFAULT } else { 0 })
464 })
465 }
466
467 fn munlock(&self, addr: u64, length: u64) -> result::Result<(), Error> {
468 // SAFETY: [`base`, `base` + `len`) is guest memory

Callers 1

process_requestMethod · 0.80

Calls 1

Tested by

no test coverage detected