[Previous] [Contents] [Index] [Next]

sem_close()

Close a named semaphore

Synopsis:

#include <semaphore.h>

int sem_close( sem_t * sem );

Library:

libc

Description:

The sem_close() function closes the named semaphore sem opened by sem_open(), releasing any system resources associated with the sem.

Returns:

0
Success.
-1
An error occurred (errno is set).

Errors:

EINVAL
Invalid semaphore descriptor sem.

Classification:

POSIX 1003.1

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

Caveats:

The mqueue manager must be running for applications to use named semaphores.

See also:

sem_init(), sem_open(), sem_unlink()


[Previous] [Contents] [Index] [Next]