int sem_close (
sem_t *sem) ;
The sem_close function makes a semaphore available for reuse by deallocating any system resources allocated for use by the current process for the named semaphore indicated by sem.
If the semaphore has not been removed with a call to sem_unlink, sem_close does not change the current state of the semaphore.
If the semaphore has been removed with a call to sem_unlink after the most recent call to sem_open with O_CREAT, the semaphore is no longer available after all processes that opened the semaphore close it.
On a successful call, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate that an error occurred.
The sem_close function fails under the following condition:
Functions: sem_init(3), sem_open(3), sem_unlink(3) delim off