1SEM_CLOSE(3) Linux Programmer's Manual SEM_CLOSE(3)
2
3
4
6 sem_close - close a named semaphore
7
9 #include <semaphore.h>
10
11 int sem_close(sem_t *sem);
12
14 sem_close() closes the named semaphore referred to by sem, allowing any
15 resources that the system has allocated to the calling process for this
16 semaphore to be freed.
17
19 All open named semaphores are automatically closed on process termina‐
20 tion, or upon execve(2).
21
23 On success sem_close() returns 0; on error, -1 is returned, with errno
24 set to indicate the error.
25
27 EINVAL sem is not a valid semaphore.
28
30 POSIX.1-2001.
31
33 sem_getvalue(3), sem_open(3), sem_post(3), sem_unlink(3), sem_wait(3),
34 sem_overview(7)
35
36
37
38Linux 2.6.16 2006-03-25 SEM_CLOSE(3)