mq_unlink(3)
π mq_unlink(3) β bestie edition
okay so real quick, this is mq_unlink(3), a page from the Library Functions Manual, and it's all about yeeting a message queue name into the void π«Ά
β¨ NAME β¨
mq_unlink β remove a message queue
π LIBRARY π
Real-time library (that's librt, and you link it with -lrt) π
π¦ SYNOPSIS π¦
#include <mqueue.h>
int mq_unlink(const char *name);
πΈ DESCRIPTION πΈ
okay so mq_unlink() removes the specified message queue name. and bestie, it's immediate β the message queue name is gone the second this call goes through, no hesitation, no waiting around, main character energy fr fr π
but here's the tea: the queue itself isn't destroyed right away. it gets destroyed once any other processes that have the queue open close their descriptors referring to the queue. so like... it's a "you can leave but the party keeps going until everyone leaves" kinda situation β¨
π RETURN VALUE π
- on success,
mq_unlink()returns0β slay, we love a clean win π - on error,
-1is returned, anderrnois set to indicate the error π
π ERRORS π
EACCESβ the caller does not have permission to unlink this message queue. like, the door is locked and you are not on the list bestie πENAMETOOLONGβnamewas too long. it's giving "essay when they asked for a text" πENOENTβ there is no message queue with the givenname. nothing there. ghosted. literally nothing to unlink π
π§ ATTRIBUTES π§
for an explanation of the terms used in this section, see attributes(7), okay?
- Interface:
mq_unlink() - Attribute: Thread safety
- Value:
MT-Safe
so yeah, it's thread safe, no cap β multiple threads can be in there at the same time and nobody's fighting π«Ά
π STANDARDS π
POSIX.1-2008. periodt. π
β HISTORY β
POSIX.1-2001. so it's been iconic since way back, not me being nostalgic π
π₯ SEE ALSO π₯
mq_close(3), mq_getattr(3), mq_notify(3), mq_open(3), mq_receive(3), mq_send(3), mq_overview(7)
go read those too, iykyk πβ¨
and that's the whole page, bestie!! this one's from Linux man-pages 6.20, dated 2026-02-08 β the mq_unlink(3) page, signed, sealed, delivered π
π¦ where this page comes from
- 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 6.20
- π the page's license: Linux-man-pages-copyleft
- Copyright 2006, Michael Kerrisk <mtk.manpages@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms