Skip to content
BSD syscall#263

svc · unix #263

shmctl

Performs control operations (stat, set, remove) on a System V shared-memory segment.

Prototype

int shmctl(int shmid, int cmd, struct shmid_ds *buf);

Returns: int

Arguments

NameTypeDirDescription
shmidint-
cmdint-
bufstruct shmid_ds-

Version history

XNU tagmacOS#
xnu-1456.1.26macOS 10.6 Snow Leopard263
xnu-1486.2.11263
xnu-1504.15.3263
xnu-1504.3.12263
xnu-1504.7.4263
xnu-1504.9.17263
xnu-1504.9.26263
xnu-1504.9.37263

Notes

Supports IPC_STAT, IPC_SET and IPC_RMID. IPC_RMID schedules the segment for destruction once the last attach is released — existing attachments keep working. macOS does not implement the Linux extensions SHM_LOCK / SHM_UNLOCK.

Related APIs

shmatshmdtshmgetipcsipcrm