sys_shm.h(7POSIX)
π sys/shm.h β XSI shared memory facility π
okay bestie, so this page is from the POSIX Programmer's Manual (the 7POSIX section, iykyk). Before we even start, real talk:
Heads up: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so go check the corresponding Linux manual page for the deets on Linux behavior), or honestly the interface may not even be implemented on Linux at all. Not me being dramatic, that's just what it says. π
β¨ NAME β¨
sys/shm.h β the XSI shared memory facility, aka the place where processes share memory and become besties π«Ά
πΈ SYNOPSIS πΈ
#include <sys/shm.h>
π DESCRIPTION π
okay so the <sys/shm.h> header shall define these symbolic constants, no cap:
SHM_RDONLYβ attach read-only (otherwise it's read-write, bestie)SHM_RNDβ round the attach address toSHMLBASHMLBAβ segment low boundary address multiple
Then it shall define the following data types through typedef:
shmatt_tβ an unsigned integer used for the number of current attaches, and it must be able to store values at least as large as aunsigned short. so like, big enough, okay?? π
And it shall define the shmid_ds structure, which shall include these members:
struct ipc_perm shm_perm Operation permission structure.
size_t shm_segsz Size of segment in bytes.
pid_t shm_lpid Process ID of last shared memory operation.
pid_t shm_cpid Process ID of creator.
shmatt_t shm_nattch Number of current attaches.
time_t shm_atime Time of last shmat().
time_t shm_dtime Time of last shmdt().
time_t shm_ctime Time of last change by shmctl().
The <sys/shm.h> header shall define the pid_t, size_t, and time_t types exactly as described in <sys/types.h>. periodt.
The following shall be declared as functions β and bestie, they may also be defined as macros, so don't come for me when they are. Function prototypes shall be provided:
void *shmat(int, const void *, int);
int shmctl(int, int, struct shmid_ds *);
int shmdt(const void *);
int shmget(key_t, size_t, int);
In addition, the <sys/shm.h> header shall include the <sys/ipc.h> header. it's giving family reunion π
The following sections are informative. (so like, bonus content, not the rules-rules)
π APPLICATION USAGE π
None. literally nothing. iconic of it honestly. π
π§ RATIONALE π§
None. also nothing. she said "no thoughts, head empty" π
π¦ FUTURE DIRECTIONS π¦
None. the future is⦠also nothing. slay.
β SEE ALSO β
<sys_ipc.h><sys_types.h>- The System Interfaces volume of POSIX.1β2017:
shmat(),shmctl(),shmdt(),shmget()
π COPYRIGHT π
okay this part is the legal text and I am NOT paraphrasing legal text, bestie, so here it is exactly as it comes:
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
and that's the whole page, bestie π«Ά this one's brought to you by IEEE/The Open Group, 2017, and the page is literally called sys_shm.h(7POSIX) β go share some memory with someone you love. mwah π
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms