devela::_dep::nc

Function mlock

pub unsafe fn mlock(addr: *const c_void, len: usize) -> Result<(), i32> 
Available on crate feature dep_nc only.
Expand description

Lock memory.

§Examples

let mut passwd_buf = vec![0; 64];
let ret = unsafe { nc::mlock(passwd_buf.as_ptr() as *const _, passwd_buf.len()) };
assert!(ret.is_ok());