1SEM_CLOSE(3)               Linux Programmer's Manual              SEM_CLOSE(3)
2
3
4

NAME

6       sem_close - close a named semaphore
7

SYNOPSIS

9       #include <semaphore.h>
10
11       int sem_close(sem_t *sem);
12
13       Link with -pthread.
14

DESCRIPTION

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

RETURN VALUE

21       On  success sem_close() returns 0; on error, -1 is returned, with errno
22       set to indicate the error.
23

ERRORS

25       EINVAL sem is not a valid semaphore.
26

CONFORMING TO

28       POSIX.1-2001.
29

NOTES

31       All open named semaphores are automatically closed on process  termina‐
32       tion, or upon execve(2).
33

SEE ALSO

35       sem_getvalue(3),  sem_open(3), sem_post(3), sem_unlink(3), sem_wait(3),
36       sem_overview(7)
37

COLOPHON

39       This page is part of release 3.53 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                             2012-05-13                      SEM_CLOSE(3)
Impressum