1sem_unlink(3) Library Functions Manual sem_unlink(3)
2
3
4
6 sem_unlink - remove a named semaphore
7
9 POSIX threads library (libpthread, -lpthread)
10
12 #include <semaphore.h>
13
14 int sem_unlink(const char *name);
15
17 sem_unlink() removes the named semaphore referred to by name. The sem‐
18 aphore name is removed immediately. The semaphore is destroyed once
19 all other processes that have the semaphore open close it.
20
22 On success sem_unlink() returns 0; on error, -1 is returned, with errno
23 set to indicate the error.
24
26 EACCES The caller does not have permission to unlink this semaphore.
27
28 ENAMETOOLONG
29 name was too long.
30
31 ENOENT There is no semaphore with the given name.
32
34 For an explanation of the terms used in this section, see at‐
35 tributes(7).
36
37 ┌────────────────────────────────────────────┬───────────────┬─────────┐
38 │Interface │ Attribute │ Value │
39 ├────────────────────────────────────────────┼───────────────┼─────────┤
40 │sem_unlink() │ Thread safety │ MT-Safe │
41 └────────────────────────────────────────────┴───────────────┴─────────┘
42
44 POSIX.1-2008.
45
47 POSIX.1-2001.
48
50 sem_getvalue(3), sem_open(3), sem_post(3), sem_wait(3), sem_overview(7)
51
52
53
54Linux man-pages 6.04 2023-03-30 sem_unlink(3)