semctl() is used to manage semaphore sets. You can use it to change values, check status, or delete a semaphore set.
function : semctl(intsemid, int semnum, int cmd, union semnum arg)
semid: ID of the semaphore set.
semnum: The index of the specific semaphore in the set (some commands ignore this).
cmd: What you want to do like remove a semaphore or get/set its value.
arg: Extra data needed for some commands (sent using a union).
IPC_RMID: Deletes the semaphore set and frees up its resources
GETVAL: Gets the value of a single semaphore.
SETVAL: Sets the value of a single semaphore.
GETALL: Gets values of all semaphores in the set.
SETALL: Sets values of all semaphores in the set.
It looks like you're new here. If you want to get involved, click one of these buttons!