Expand description
POSIX Shared Memory (shm_open / shm_unlink)
Provides named shared memory objects accessible via /dev/shm semantics.
Used by Wayland compositors and other IPC-heavy applications for zero-copy
buffer sharing between processes.
This module implements the kernel-side of the POSIX shared memory API:
shm_open(): Create or open a named shared memory objectshm_unlink(): Remove a named shared memory objectftruncate(): Set the size of the shared memory objectmmap(MAP_SHARED): Map the shared memory into a process address space
Named objects are stored in a global registry keyed by name. Each object tracks its physical backing frames and per-process virtual mappings.
Structs§
- ShmMapping
- A per-process mapping of a shared memory object.
- ShmObject
- A named shared memory object.
- ShmOpen
Flags - Open flags for shm_open (mirror POSIX O_CREAT, O_EXCL, O_RDONLY, O_RDWR).
Constants§
- SHM_
MAX_ OBJECTS - Maximum number of concurrent shared memory objects.
- SHM_
MAX_ SIZE - Maximum size of a single shared memory object (256 MB).
- SHM_
NAME_ MAX - Maximum name length for a shared memory object.
Functions§
- shm_
close - Close a reference to a shared memory object.
- shm_
count - Get the number of active shared memory objects.
- shm_
open - Create or open a named shared memory object.
- shm_
stat - Get information about a shared memory object.
- shm_
truncate - Set the size of a shared memory object (analogous to ftruncate).
- shm_
unlink - Remove a named shared memory object.