1 .\" Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .TH sem_close 3 (date) "Linux man-pages (unreleased)"
7 sem_close \- close a named semaphore
10 .RI ( libpthread ", " \-lpthread )
13 .B #include <semaphore.h>
15 .BI "int sem_close(sem_t *" sem );
19 closes the named semaphore referred to by
21 allowing any resources that the system has allocated to
22 the calling process for this semaphore to be freed.
26 returns 0; on error, \-1 is returned, with
28 set to indicate the error.
33 is not a valid semaphore.
35 For an explanation of the terms used in this section, see
43 Interface Attribute Value
46 T} Thread safety MT-Safe
52 POSIX.1-2001, POSIX.1-2008.
54 All open named semaphores are automatically closed on process