sys_ipc.h(7POSIX)

๐Ÿ’– sys_ipc.h(7POSIX) โ€” the XSI IPC access-structure glow-up ๐Ÿ’–

okay bestie, before we even START, real talk: this page lives in the POSIX Programmer's Manual. That's the vibe. But heads up โ€” the Linux implementation of this interface may differ (so go peek at the matching Linux manual page if you need Linux deets, fr), or honestly the interface might not even be implemented on Linux at all. ๐Ÿ™ˆ Not me warning you upfront.


โœจ NAME โœจ

sys/ipc.h โ€” the XSI interprocess communication access structure. it's giving "shared secrets between processes." ๐Ÿ‘‘


๐ŸŒธ SYNOPSIS ๐ŸŒธ

#include <sys/ipc.h>

that's it. that's the whole incantation. slay. ๐Ÿ’…


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so the <sys/ipc.h> header is the mutual bestie of three XSI interprocess communication (IPC) mechanisms, and they are:

  • messages
  • semaphores
  • shared memory

all three of them use one common structure type โ€” ipc_perm โ€” to pass around the info that determines whether you're actually allowed to do an IPC operation. like a bouncer but for kernel objects. ๐Ÿซถ

The <sys/ipc.h> header shall define the ipc_perm structure, which shall include the following 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.

The <sys/ipc.h> header shall define the uid_t, gid_t, mode_t, and key_t types as described in <sys/types.h>. periodt.

The <sys/ipc.h> header shall define the following symbolic constants. ๐ŸŽ€

๐Ÿ”ฅ 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.

The following shall be declared as a function and may also be defined as a macro. A function prototype shall be provided. ๐Ÿ‘‡

key_t  ftok(const char *, int);

and then โ€” iconic behavior โ€” the following sections are informative. meaning: they're vibes only, no rules. ๐Ÿ˜Œ


๐Ÿ’œ APPLICATION USAGE ๐Ÿ’œ

None. literally nothing. the void. ๐Ÿ•ณ๏ธโœจ


๐ŸŒˆ RATIONALE ๐ŸŒˆ

None. also nothing. we stay unbothered. ๐Ÿงš


โญ FUTURE DIRECTIONS โญ

None. the future is a blank canvas and honestly? obsessed. ๐ŸŽจ


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

  • <sys_types.h>
  • The System Interfaces volume of POSIX.1โ€2017, ftok()

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 .


ngl that copyright block is the longest relationship commitment on this whole page and I respect it deeply. ๐Ÿ’–

and that's a wrap, bestie โ€” this one was brought to you by IEEE/The Open Group, 2017, signing off like the absolute icons they are. stay hydrated, read your headers, mwah. ๐Ÿ’…โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from