Function mlock2
pub unsafe fn mlock2(
addr: *const c_void,
len: usize,
flags: i32,
) -> 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::mlock2(passwd_buf.as_ptr() as *const _, passwd_buf.len(), nc::MCL_CURRENT) };
assert!(ret.is_ok());