sys_msg.h(7POSIX)
π sys_msg.h β XSI message queue structures π
okay bestie, so this one is sys_msg.h from the POSIX Programmer's Manual (that's the 7POSIX section of the manual, iykyk) and it's literally the header that defines all the XSI message queue stuff. it's giving β¨ infrastructure β¨ and honestly? we're obsessed.
π PROLOG π
so real talk first: this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ (so like, go check the corresponding Linux manual page for the deets on Linux behavior, bestie), or β and this is the messy part β the interface may not be implemented on Linux <em>at all</em>. π
β¨ NAME β¨
sys/msg.h β XSI message queue structures π¦
πΈ SYNOPSIS πΈ
#include <sys/msg.h>
π DESCRIPTION π
okay so the <sys/msg.h> header shall define the following data types, and it does it 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? they shall be unsigned integer types that are able to store values at least as large as a type unsigned short. so they're not playing around, they can hold a whole unsigned short's worth of numbers minimum, periodt. πͺ
the <sys/msg.h> header shall also define the following symbolic constant as a message operation flag:
MSG_NOERRORβ no error if big message. (yes that's literally the description. no error if big message. iconic brevity. π)
then we get the msqid_ds structure, which shall include these members, and bestie there are eight of them:
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.
let's break the vibe check down one by one π«Ά
struct ipc_perm msg_permβ the operation permission structure. who's allowed to do what πmsgqnum_t msg_qnumβ number of messages currently on queue. the count, live, right now.msglen_t msg_qbytesβ maximum number of bytes allowed on queue. the ceiling, the limit, the "don't test me" number.pid_t msg_lspidβ process ID of the lastmsgsnd().pid_t msg_lrpidβ process ID of the lastmsgrcv().time_t msg_stimeβ time of the lastmsgsnd().time_t msg_rtimeβ time of the lastmsgrcv().time_t msg_ctimeβ time of the last change. β°
the <sys/msg.h> header shall define the pid_t, size_t, ssize_t, and time_t types as described in <sys/types.h>. so like, they're defined there, this header just knows about them, no cap. π
and 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);
four functions, four absolutely load-bearing little guys π₯
plus (and this is the bonus round), the <sys/msg.h> header shall include the <sys/ipc.h> header. headers including headers, it's a whole family tree. π§
β οΈ heads up: the following sections are informative. not normative, just vibes.
π APPLICATION USAGE π
none. that's it. nothing. empty. the void. π
π RATIONALE π
none. again! nothing! the girlies said "no notes" and meant it. π
π FUTURE DIRECTIONS π
none. (three for three, bestie. the future is a mystery and this page is not about to speculate.) β¨
π SEE ALSO π
<sys_ipc.h><sys_types.h>- The System Interfaces volume of POSIX.1β2017:
msgctl(),msgget(),msgrcv(),msgsnd()
like yeah go read those too, they're the sequel. π
π COPYRIGHT π
okay so this is the part where we give credit, and credit is due:
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 <strong>the referee document</strong>. 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 .
π«Ά okay that's the whole page bestie!! this one's brought to you by IEEE/The Open Group, dated 2017, and it lives at sys_msg.h(7POSIX). slay, go queue some messages, ily πβ¨π
π¦ 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