sys_msg.h(0P)

πŸ’– sys_msg.h(0P) πŸ’–

okay bestie, so this is the manual page for sys_msg.h, and it lives in the POSIX Programmer's Manual. we're in the 0P girlies today. πŸŽ€


🌸 PROLOG 🌸

okay so before literally anything else: this manual page is part of the POSIX Programmer's Manual. but heads up β€” the Linux implementation of this interface may differ (so if you're on Linux, go consult the corresponding Linux manual page for the actual deets), or honestly the interface may not be implemented on Linux at all. vibe check your platform first, bestie. πŸ’€


✨ NAME ✨

sys/msg.h β€” XSI message queue structures. that's it, that's the whole name. iconic.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <sys/msg.h>

πŸ‘‘ DESCRIPTION πŸ‘‘

so the <sys/msg.h> header shall define the following data types through typedef:

  • msgqnum_t β€” used for the number of messages in the message queue. πŸ’Œ
  • msglen_t β€” used for the number of bytes allowed in a message queue.

and these types shall be unsigned integer types that are able to store values at least as large as a type unsigned short. no cap.


next up, the <sys/msg.h> header shall define the following symbolic constant as a message operation flag:

  • MSG_NOERROR β€” no error if big message. (yes that's literally how it's phrased, she's short and sweet and she ate. πŸ’…)

and then the <sys/msg.h> header shall define the msqid_ds structure, which shall include these members:

struct ipc_perm msg_perm   Operation permission structure.
msgqnum_t       msg_qnum   Number of messages currently on queue.
msglen_t        msg_qbytes Maximum number of bytes allowed on queue.
pid_t           msg_lspid  Process ID of last msgsnd().
pid_t           msg_lrpid  Process ID of last msgrcv().
time_t          msg_stime  Time of last msgsnd().
time_t          msg_rtime  Time of last msgrcv().
time_t          msg_ctime  Time of last change.

so real quick, translating the vibes:

  • msg_perm is the operation permission structure 🫢
  • msg_qnum is how many messages are currently chillin' on the queue
  • msg_qbytes is the max number of bytes allowed on the queue
  • msg_lspid is the process ID of the last msgsnd()
  • msg_lrpid is the process ID of the last msgrcv()
  • msg_stime is the time of the last msgsnd()
  • msg_rtime is the time of the last msgrcv()
  • msg_ctime is the time of the last change

also, the <sys/msg.h> header shall define the pid_t, size_t, ssize_t, and time_t types as described in <sys/types.h>. go read that one too, iykyk. πŸ“š


the following shall be declared as functions and may also be defined as macros. function prototypes shall be provided. πŸ‘‡

int       msgctl(int, int, struct msqid_ds *);
int       msgget(key_t, int);
ssize_t   msgrcv(int, void *, size_t, long, int);
int       msgsnd(int, const void *, size_t, int);

and in addition, the <sys/msg.h> header shall include the <sys/ipc.h> header. she brings her friend everywhere, we love a supportive queen. 🧚


the following sections are informative. (translation: they're the bonus content, not the requirements. πŸ’œ)


πŸ“ APPLICATION USAGE πŸ“

none. literally nothing. the void. πŸ•³οΈ


🌈 RATIONALE 🌈

none. also the void. πŸ’€


⭐ FUTURE DIRECTIONS ⭐

none. the void continues. but make it slay. ✨


πŸ’œ SEE ALSO πŸ’œ

  • <sys_ipc.h>
  • <sys_types.h>
  • The System Interfaces volume of POSIX.1‐2017: msgctl(), msgget(), msgrcv(), msgsnd()

okay this part is the serious bit so listen up bestie, no jokes here:

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, babe 🫢 this edition was brought to you by IEEE/The Open Group, dated 2017, and the page is sys_msg.h(0P). go forth and queue those messages, main character. πŸ’…πŸŒΈ

πŸ“¦ where this page comes from