semop()
Usage: int semop( int semid, struct sembuf *sops,
Increment, decrement, or test semaphores elements for a zero value.
From <sys/sem.h>:
sops->sem_num, sops->sem_op, sops->sem_flg;
If sem_op is positive, semop() adds value to semaphore element and awakens processes waiting for the element to increase
if sem_op is negative, semop() adds the value to the semaphore element and if < 0, semop() sets to 0 and blocks until it increases
if sem_op is zero and the semaphore element value is not zero, semop() blocks the calling process until the value becomes zero
if semop() is interrupted by a signal, it returns -1 with errno = EINTR