mqueue.h(0P)
π mqueue.h β message queues (REALTIME)
okay bestie, welcome to the POSIX Programmer's Manual β¨ this one is mqueue.h(0P) and it's literally the header that makes POSIX message queues happen. sit down, hydrate, let's go π«Ά
πΈ PROLOG
so like, this manual page is part of the POSIX Programmer's Manual. quick heads up though, no cap:
the Linux implementation of this interface may differ β so bestie, consult the corresponding Linux manual page for the deets on Linux behavior β or honestly? the interface might not even be implemented on Linux at all. π vibe check accordingly.
β¨ NAME
mqueue.h β message queues (REALTIME) π
π¦ SYNOPSIS
#include <mqueue.h>
that's it. that's the whole vibe. one include and you're in. π
π DESCRIPTION
okay so the <mqueue.h> header shall define the mqd_t type, which is what we use for message queue descriptors. and listen β it is not an array type. just a type. periodt. π
ββοΈ
it also shall define the pthread_attr_t, size_t, and ssize_t types, exactly as described in <sys/types.h>. slay, reuse the types. π
and it shall define the struct timespec structure as described in <time.h>. β
the tag sigevent shall be declared as naming an incomplete structure type β its contents live over in the <signal.h> header, so don't come for it here, she's mysterious on purpose. π§
now for the main character: the <mqueue.h> header shall define the mq_attr structure, which is used for getting and setting the attributes of a message queue. attributes are initially set when the message queue is created. and an mq_attr structure shall have at least these fields:
long mq_flagsβ message queue flags. π©long mq_maxmsgβ maximum number of messages.long mq_msgsizeβ maximum message size.long mq_curmsgsβ number of messages currently queued.
the following shall be declared as functions, and may also be defined as macros β function prototypes shall be provided. (yes bestie, macros are allowed, it's giving flexible π )
int mq_close(mqd_t);
int mq_getattr(mqd_t, struct mq_attr *);
int mq_notify(mqd_t, const struct sigevent *);
mqd_t mq_open(const char *, int, ...);
ssize_t mq_receive(mqd_t, char *, size_t, unsigned *);
int mq_send(mqd_t, const char *, size_t, unsigned);
int mq_setattr(mqd_t, const struct mq_attr *restrict,
struct mq_attr *restrict);
ssize_t mq_timedreceive(mqd_t, char *restrict, size_t,
unsigned *restrict, const struct timespec *restrict);
int mq_timedsend(mqd_t, const char *, size_t, unsigned,
const struct timespec *);
int mq_unlink(const char *);
also β including the <mqueue.h> header may make visible symbols defined in these headers: <fcntl.h>, <signal.h>, and <time.h>. lowkey sneaky, highkey useful. π
and the following sections are informative. (i.e. not normative, just tea. β)
π APPLICATION USAGE
None.
literally nothing. empty. the void. she said no thoughts, head empty. π
π RATIONALE
None.
also empty. two empty sections in a row, iconic honestly. π
π₯ FUTURE DIRECTIONS
None.
nothing's changing, bestie. she's stable. she's at peace. πΈ
π SEE ALSO
<fcntl.h><signal.h><sys_types.h><time.h>
and from the System Interfaces volume of POSIX.1β2017:
mq_close()mq_getattr()mq_notify()mq_open()mq_receive()mq_send()mq_setattr()mq_unlink()
go read those, they're the whole friend group fr fr π«Ά
π COPYRIGHT
okay legal bestie moment, stay 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 .
not me getting emotional over a copyright notice π but fr, respect the standard.
and that's the whole page, bestie!! π this little queen is from IEEE/The Open Group, 2017, filed under mqueue.h(0P) β so if you ever need to cite her, you know exactly who she is and when she showed up. mwah π now go queue some messages, you absolute icon. πβ¨
π¦ 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