⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module posix_shm

Module posix_shm 

Source
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 object
  • shm_unlink(): Remove a named shared memory object
  • ftruncate(): Set the size of the shared memory object
  • mmap(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.
ShmOpenFlags
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.