Skip to content
BSD syscall#254

svc · unix #254

semctl

Performs control operations on a System V semaphore set.

Prototype

int semctl(int semid, int semnum, int cmd, semun_t arg);

Returns: int

Arguments

NameTypeDirDescription
semidint-
semnumint-
cmdint-
argsemun_t-

Version history

XNU tagmacOS#
xnu-1456.1.26macOS 10.6 Snow Leopard254
xnu-1486.2.11254
xnu-1504.15.3254
xnu-1504.3.12254
xnu-1504.7.4254
xnu-1504.9.17254
xnu-1504.9.26254
xnu-1504.9.37254

Notes

Supports GETVAL, SETVAL, GETALL, SETALL, IPC_STAT, IPC_SET and IPC_RMID. The fourth argument is the classic union semun, which the caller must declare manually because POSIX leaves it to the program. Removal via IPC_RMID wakes every waiter on the set with EIDRM.

Related APIs

semgetsemopipcsipcrm