Next: shmlimits, Previous: shmdt, Up: Shared Memory
Destroys allocated segments. Reads/Writes the control structures.
int shmctl (int shmid, int cmd, struct shmid_ds *buf);
The user must execute an IPC_RMID shmctl call to free the memory allocated by the shared segment. Otherwise all the pages faulted in will continue to live in memory or swap.
Errors:
EACCES : Do not have permission for requested access.
EFAULT : buf is not accessible.
EINVAL : shmid < 0 or unused.
EIDRM : identifier destroyed.
EPERM : not creator, owner or super-user (IPC_SET, IPC_RMID).