sys_ipc.h(0P)
๐ sys_ipc.h โ XSI interprocess communication access structure ๐
okay bestie, so this is sys_ipc.h, and it lives in the POSIX Programmer's Manual (section 0P, if you're keeping track, which you should be, iykyk). Pull up a chair, grab a strawberry ๐, and let's get into it.
๐ธ PROLOG ๐ธ
Real talk before we even start: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ โ so if you're on Linux, go consult the corresponding Linux manual page for the deets on Linux behavior. Or the interface might just... not be implemented on Linux at all. ๐ญ Check before you commit, fr fr.
โจ NAME โจ
sys/ipc.h โ XSI interprocess communication access structure. That's it, that's the whole vibe. ๐
๐ SYNOPSIS ๐
#include <sys/ipc.h>
One include. So simple. So iconic. ๐
๐ฆ DESCRIPTION ๐ฆ
So the <sys/ipc.h> header is used by three whole mechanisms for XSI interprocess communication (IPC), and they are:
- messages
- semaphores
- shared memory
And the way they all stay in sync? They all use one common structure type, ipc_perm, to pass along the information used in figuring out permission to perform an IPC operation. Main character energy for real. ๐ซถ
The <sys/ipc.h> header shall define the ipc_perm structure, and it shall include these members:
uid_t uid Owner's user ID.
gid_t gid Owner's group ID.
uid_t cuid Creator's user ID.
gid_t cgid Creator's group ID.
mode_t mode Read/write permission.
Not me reading cuid and cgid and thinking "creator core" โ anyway. ๐
The <sys/ipc.h> header shall also define the uid_t, gid_t, mode_t, and key_t types, exactly as described in <sys/types.h>. No reinventing, we reuse. Periodt.
๐ Symbolic constants, besties ๐
The <sys/ipc.h> header shall define the following symbolic constants. Buckle up, there's three little sections:
๐ซ Mode bits
IPC_CREATโ Create entry if key does not exist.IPC_EXCLโ Fail if key exists.IPC_NOWAITโ Error if request must wait.
๐ Keys
IPC_PRIVATEโ Private key.
๐๏ธ Control commands
IPC_RMIDโ Remove identifier.IPC_SETโ Set options.IPC_STATโ Get options.
Like, set and get? The duality. Obsessed. ๐
๐ง The function (or macro, no pressure) ๐ง
The following shall be declared as a function and may also be defined as a macro. Either way, a function prototype shall be provided:
key_t ftok(const char *, int);
One prototype. Two arguments. Zero drama. Slay. โจ
Heads up: the following sections are informative. Which is fancy speak for "we're just chatting now, not laying down rules." ๐ซถ
๐ APPLICATION USAGE ๐
None.
(Truly nothing. The silence is deafening. ๐)
๐ญ RATIONALE ๐ญ
None.
(Nothing to justify, nothing to explain. We simply are. โจ)
๐ฎ FUTURE DIRECTIONS ๐ฎ
None.
(The future is bright and also completely unspecified. ๐ฆ)
๐ SEE ALSO ๐
<sys_types.h>- The System Interfaces volume of POSIX.1โ2017,
ftok()
Go read those too, bestie, they're literally right there. ๐
ยฉ๏ธ COPYRIGHT ยฉ๏ธ
okay so legal o'clock, bear with me:
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!! ๐
โจ brought to you by IEEE/The Open Group, dated 2017 โ sys_ipc.h(0P) signing off, mwah ๐๐๐ฆ
๐ฆ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 ยท custom
- alpine 3.23: man-pages-posix 2017a-r0 ยท custom
- alpine 3.24: man-pages-posix 2017a-r0 ยท custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 ยท SUSE-IEEE
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms