{
    "content": [
        {
            "type": "text",
            "text": "# SHM_OVERVIEW (man)\n\n## NAME\n\nshmoverview - overview of POSIX shared memory\n\n## DESCRIPTION\n\nThe  POSIX  shared memory API allows processes to communicate information by sharing a region\nof memory.\n\n## Sections\n\n- **NAME**\n- **DESCRIPTION** (4 subsections)\n- **NOTES**\n- **SEE ALSO**\n- **COLOPHON**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "SHM_OVERVIEW",
        "section": "",
        "mode": "man",
        "summary": "shmoverview - overview of POSIX shared memory",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "fchmod",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/fchmod/2/json"
            },
            {
                "name": "fchown",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/fchown/2/json"
            },
            {
                "name": "fstat",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/fstat/2/json"
            },
            {
                "name": "ftruncate",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/ftruncate/2/json"
            },
            {
                "name": "mmap",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/mmap/2/json"
            },
            {
                "name": "mprotect",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/mprotect/2/json"
            },
            {
                "name": "munmap",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/munmap/2/json"
            },
            {
                "name": "shmget",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/shmget/2/json"
            },
            {
                "name": "shmop",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/shmop/2/json"
            },
            {
                "name": "shmopen",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/shmopen/3/json"
            },
            {
                "name": "shmunlink",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/shmunlink/3/json"
            },
            {
                "name": "semoverview",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/semoverview/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 31,
                "subsections": [
                    {
                        "name": "Versions",
                        "lines": 2
                    },
                    {
                        "name": "Persistence",
                        "lines": 4
                    },
                    {
                        "name": "Linking",
                        "lines": 3
                    },
                    {
                        "name": "Accessing shared memory objects via the filesystem",
                        "lines": 4
                    }
                ]
            },
            {
                "name": "NOTES",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "COLOPHON",
                "lines": 7,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "shmoverview - overview of POSIX shared memory\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The  POSIX  shared memory API allows processes to communicate information by sharing a region\nof memory.\n\nThe interfaces employed in the API are:\n\nshmopen(3)    Create and open a new object, or open an existing object.  This  is  analogous\nto  open(2).   The  call returns a file descriptor for use by the other inter‐\nfaces listed below.\n\nftruncate(2)   Set the size of the shared memory object.  (A newly created shared memory  ob‐\nject has a length of zero.)\n\nmmap(2)        Map  the  shared  memory  object into the virtual address space of the calling\nprocess.\n\nmunmap(2)      Unmap the shared memory object from the virtual address space of  the  calling\nprocess.\n\nshmunlink(3)  Remove a shared memory object name.\n\nclose(2)       Close  the  file  descriptor  allocated  by  shmopen(3)  when it is no longer\nneeded.\n\nfstat(2)       Obtain a stat structure that describes the shared memory  object.   Among  the\ninformation returned by this call are the object's size (stsize), permissions\n(stmode), owner (stuid), and group (stgid).\n\nfchown(2)      To change the ownership of a shared memory object.\n\nfchmod(2)      To change the permissions of a shared memory object.\n",
                "subsections": [
                    {
                        "name": "Versions",
                        "content": "POSIX shared memory is supported since Linux 2.4 and glibc 2.2.\n"
                    },
                    {
                        "name": "Persistence",
                        "content": "POSIX shared memory objects have kernel persistence: a shared memory object will exist  until\nthe  system  is  shut  down,  or until all processes have unmapped the object and it has been\ndeleted with shmunlink(3)\n"
                    },
                    {
                        "name": "Linking",
                        "content": "Programs using the POSIX shared memory API must be compiled with cc -lrt to link against  the\nreal-time library, librt.\n"
                    },
                    {
                        "name": "Accessing shared memory objects via the filesystem",
                        "content": "On  Linux,  shared  memory  objects  are created in a (tmpfs(5)) virtual filesystem, normally\nmounted under /dev/shm.  Since kernel 2.6.19, Linux supports the use of access control  lists\n(ACLs) to control the permissions of objects in the virtual filesystem.\n"
                    }
                ]
            },
            "NOTES": {
                "content": "Typically,  processes must synchronize their access to a shared memory object, using, for ex‐\nample, POSIX semaphores.\n\nSystem V shared memory (shmget(2), shmop(2), etc.) is an  older  shared  memory  API.   POSIX\nshared  memory  provides  a  simpler,  and better designed interface; on the other hand POSIX\nshared memory is somewhat less widely available (especially on older systems) than  System  V\nshared memory.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "fchmod(2),  fchown(2),  fstat(2),  ftruncate(2),  mmap(2), mprotect(2), munmap(2), shmget(2),\nshmop(2), shmopen(3), shmunlink(3), semoverview(7)\n",
                "subsections": []
            },
            "COLOPHON": {
                "content": "This page is part of release 5.10 of the Linux  man-pages  project.   A  description  of  the\nproject,  information about reporting bugs, and the latest version of this page, can be found\nat https://www.kernel.org/doc/man-pages/.\n\n\n\nLinux                                        2020-08-13                              SHMOVERVIEW(7)",
                "subsections": []
            }
        }
    }
}