Performs a semaphore operation.
#include <sys/sem.h> int semop ( int semid, struct sembuf *sops, size_t nsops );
(IN) Specifies the semaphore for the operation.
(IN) Points to an array of sembuf structures that describe the semaphore operations.
(IN) Specifies the number of structures in the sops array.
If successful, returns 0; otherwise, returns -1 and sets errno to one of the following values:
The operation must succeeded on all semaphores in the set. If the operation fails on one semaphore, it fails on all semaphores in the set (undoing any actions previously performed).