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