Debian Codegraph @

upstream/debian-unstable/man3/sem_unlink.3

raw
1 '\" t
2 .\" Copyright 2006, Michael Kerrisk <[email protected]>
3 .\" Copyright, the authors of the Linux man-pages project
4 .\"
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\"
7 .TH sem_unlink 3 2026-02-08 "Linux man-pages 6.18"
8 .SH NAME
9 sem_unlink \- remove a named semaphore
10 .SH LIBRARY
11 POSIX threads library
12 .RI ( libpthread ,\~ \-lpthread )
13 .SH SYNOPSIS
14 .nf
15 .B #include <semaphore.h>
16 .P
17 .BI "int sem_unlink(const char *" name );
18 .fi
19 .SH DESCRIPTION
20 .BR sem_unlink ()
21 removes the named semaphore referred to by
22 .IR name .
23 The semaphore name is removed immediately.
24 The semaphore is destroyed once all other processes that have
25 the semaphore open close it.
26 .SH RETURN VALUE
27 On success
28 .BR sem_unlink ()
29 returns 0; on error, \-1 is returned, with
30 .I errno
31 set to indicate the error.
32 .SH ERRORS
33 .TP
34 .B EACCES
35 The caller does not have permission to unlink this semaphore.
36 .TP
37 .B ENAMETOOLONG
38 .I name
39 was too long.
40 .TP
41 .B ENOENT
42 There is no semaphore with the given
43 .IR name .
44 .SH ATTRIBUTES
45 For an explanation of the terms used in this section, see
46 .BR attributes (7).
47 .TS
48 allbox;
49 lbx lb lb
50 l l l.
51 Interface Attribute Value
52 T{
53 .na
54 .nh
55 .BR sem_unlink ()
56 T} Thread safety MT-Safe
57 .TE
58 .SH STANDARDS
59 POSIX.1-2008.
60 .SH HISTORY
61 POSIX.1-2001.
62 .SH SEE ALSO
63 .BR sem_getvalue (3),
64 .BR sem_open (3),
65 .BR sem_post (3),
66 .BR sem_wait (3),
67 .BR sem_overview (7)