2 .\" Copyright (C) 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
5 .\" %%%LICENSE_START(VERBATIM)
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date. The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein. The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
27 .TH SHM_OVERVIEW 7 2015-08-08 "Linux" "Linux Programmer's Manual"
29 shm_overview \- overview of POSIX shared memory
31 The POSIX shared memory API allows processes to communicate information
32 by sharing a region of memory.
34 The interfaces employed in the API are:
37 Create and open a new object, or open an existing object.
40 The call returns a file descriptor for use by the other
41 interfaces listed below.
44 Set the size of the shared memory object.
45 (A newly created shared memory object has a length of zero.)
48 Map the shared memory object into the virtual address space
49 of the calling process.
52 Unmap the shared memory object from the virtual address space
53 of the calling process.
56 Remove a shared memory object name.
59 Close the file descriptor allocated by
61 when it is no longer needed.
66 structure that describes the shared memory object.
67 Among the information returned by this call are the object's
78 To change the ownership of a shared memory object.
81 To change the permissions of a shared memory object.
83 POSIX shared memory is supported since Linux 2.4 and glibc 2.2.
85 POSIX shared memory objects have kernel persistence:
86 a shared memory object will exist until the system is shut down,
87 or until all processes have unmapped the object and it has been deleted with
90 Programs using the POSIX shared memory API must be compiled with
92 to link against the real-time library,
94 .SS Accessing shared memory objects via the filesystem
95 On Linux, shared memory objects are created in a
97 virtual filesystem, normally mounted under
99 Since kernel 2.6.19, Linux supports the use of access control lists (ACLs)
100 to control the permissions of objects in the virtual filesystem.
102 Typically, processes must synchronize their access to a shared
103 memory object, using, for example, POSIX semaphores.
105 System V shared memory
108 etc.) is an older shared memory API.
109 POSIX shared memory provides a simpler, and better designed interface;
110 on the other hand POSIX shared memory is somewhat less widely available
111 (especially on older systems) than System V shared memory.