1 .\" Copyright (C) 2008, Linux Foundation, written by Michael Kerrisk
2 .\" <mtk.manpages@gmail.com>
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .TH shm_overview 7 (date) "Linux man-pages (unreleased)"
8 shm_overview \- overview of POSIX shared memory
10 The POSIX shared memory API allows processes to communicate information
11 by sharing a region of memory.
13 The interfaces employed in the API are:
16 Create and open a new object, or open an existing object.
19 The call returns a file descriptor for use by the other
20 interfaces listed below.
23 Set the size of the shared memory object.
24 (A newly created shared memory object has a length of zero.)
27 Map the shared memory object into the virtual address space
28 of the calling process.
31 Unmap the shared memory object from the virtual address space
32 of the calling process.
35 Remove a shared memory object name.
38 Close the file descriptor allocated by
40 when it is no longer needed.
45 structure that describes the shared memory object.
46 Among the information returned by this call are the object's
57 To change the ownership of a shared memory object.
60 To change the permissions of a shared memory object.
62 POSIX shared memory is supported since Linux 2.4 and glibc 2.2.
64 POSIX shared memory objects have kernel persistence:
65 a shared memory object will exist until the system is shut down,
66 or until all processes have unmapped the object and it has been deleted with
69 Programs using the POSIX shared memory API must be compiled with
71 to link against the real-time library,
73 .SS Accessing shared memory objects via the filesystem
74 On Linux, shared memory objects are created in a
76 virtual filesystem, normally mounted under
78 Since kernel 2.6.19, Linux supports the use of access control lists (ACLs)
79 to control the permissions of objects in the virtual filesystem.
81 Typically, processes must synchronize their access to a shared
82 memory object, using, for example, POSIX semaphores.
84 System V shared memory
87 etc.) is an older shared memory API.
88 POSIX shared memory provides a simpler, and better designed interface;
89 on the other hand POSIX shared memory is somewhat less widely available
90 (especially on older systems) than System V shared memory.