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
13 Link with -lrt or -pthread.
14
16 sem_close() closes the named semaphore referred to by sem, allowing any
17 resources that the system has allocated to the calling process for this
18 semaphore to be freed.
19
21 On success sem_close() returns 0; on error, -1 is returned, with errno
22 set to indicate the error.
23
25 EINVAL sem is not a valid semaphore.
26
28 POSIX.1-2001.
29
31 All open named semaphores are automatically closed on process termina‐
32 tion, or upon execve(2).
33
35 sem_getvalue(3), sem_open(3), sem_post(3), sem_unlink(3), sem_wait(3),
36 sem_overview(7)
37
39 This page is part of release 3.22 of the Linux man-pages project. A
40 description of the project, and information about reporting bugs, can
41 be found at http://www.kernel.org/doc/man-pages/.
42
43
44
45Linux 2006-03-25 SEM_CLOSE(3)