Closes the semaphore.
destroy sem destroys the unnamed semaphore pointed to by sem.
destroy sem
sem
sem_getvalue sem returns a value of sem.
sem_getvalue sem
sem_init semop pshared ival initializes the unnamed semaphore.
sem_init semop pshared ival
sem_open name oflags mode ival creates or opens the named semaphore specified by name.
sem_open name oflags mode ival
name
sem_post sem increments (unlocks) the semaphore pointed to by sem.
sem_post sem
sem_trywait sem decrements (locks) the semaphore pointed to by sem only if the value is non-zero.
sem_trywait sem
Erases the named semaphore.
sem_wait sem decrements (locks) the semaphore pointed to by sem, but blocks if the value of sem is zero, until the value is non-zero and the value can be decremented.
sem_wait sem