1shm_unlink(3C) Standard C Library Functions shm_unlink(3C)
2
3
4
6 shm_unlink - remove a shared memory object
7
9 #include <sys/mman.h>
10
11 int shm_unlink(const char *name);
12
13
15 The shm_unlink() function removes the name of the shared memory object
16 named by the string pointed to by name. If one or more references to
17 the shared memory object exists when the object is unlinked, the name
18 is removed before shm_unlink() returns, but the removal of the memory
19 object contents will be postponed until all open and mapped references
20 to the shared memory object have been removed.
21
23 Upon successful completion, shm_unlink() returns 0. Otherwise it
24 returns −1 and sets errno to indicate the error condition, and the
25 named shared memory object is not affected by this function call.
26
28 The shm_unlink() function will fail if:
29
30 EACCES Permission is denied to unlink the named shared memory
31 object.
32
33
34 ENAMETOOLONG The length of the name string exceeds PATH_MAX, or a
35 pathname component is longer than NAME_MAX while
36 _POSIX_NO_TRUNC is in effect.
37
38
39 ENOENT The named shared memory object does not exist.
40
41
42 ENOSYS The shm_unlink() function is not supported by the sys‐
43 tem.
44
45
47 See attributes(5) for descriptions of the following attributes:
48
49
50
51
52 ┌─────────────────────────────┬─────────────────────────────┐
53 │ATTRIBUTE TYPE │ATTRIBUTE VALUE │
54 ├─────────────────────────────┼─────────────────────────────┤
55 │Interface Stability │Committed │
56 ├─────────────────────────────┼─────────────────────────────┤
57 │MT-Level │MT-Safe │
58 ├─────────────────────────────┼─────────────────────────────┤
59 │Standard │See standards(5). │
60 └─────────────────────────────┴─────────────────────────────┘
61
63 close(2), mmap(2), mlock(3C), shm_open(3C), attributes(5), standards(5)
64
66 Solaris 2.6 was the first release to support the Asynchronous Input and
67 Output option. Prior to this release, this function always returned −1
68 and set errno to ENOSYS.
69
70
71
72SunOS 5.11 5 Feb 2008 shm_unlink(3C)