Function shmctl
pub unsafe fn shmctl(
shmid: i32,
cmd: i32,
buf: &mut shmid_ds_t,
) -> Result<i32, i32> ⓘ
Available on crate feature
dep_nc
only.Expand description
System V shared memory control.
§Examples
let size = 4 * nc::PAGE_SIZE;
let flags = nc::IPC_CREAT | nc::IPC_EXCL | 0o600;
let ret = unsafe { nc::shmget(nc::IPC_PRIVATE, size, flags) };
assert!(ret.is_ok());
let shmid = ret.unwrap();
let mut buf = nc::shmid_ds_t::default();
let ret = unsafe { nc::shmctl(shmid, nc::IPC_RMID, &mut buf) };
assert!(ret.is_ok());