mq_unlink(3)
๐ mq_unlink โ NAME (iykyk) ๐
okay so bestie, this one's from the Library Functions Manual, and it's called mq_unlink โ literally just "remove a message queue" ๐
๐ LIBRARY ๐
it lives in the real-time library: librt, and you link it with -lrt. no cap.
โจ SYNOPSIS โจ
#include <mqueue.h>
int mq_unlink(const char *name);
๐ฆ DESCRIPTION ๐ฆ
okay so here's the vibe: mq_unlink() removes the specified message queue name.
and the way that the name gets removed immediately โ right away, no waiting, periodt. but the queue itself? the queue doesn't get destroyed until any other processes that have the queue open close their descriptors referring to the queue. so like... it's giving "you can leave but the party isn't over until everybody leaves" ๐ซถ
no cap, that's the whole thing.
๐ธ RETURN VALUE ๐ธ
- on success,
mq_unlink()returns0โจ - on error,
-1comes back, anderrnogets set to tell you which error it was ๐
๐ ERRORS ๐
EACCESโ the caller does not have permission to unlink this message queue. like, not your queue, not your business, bestie ๐ญENAMETOOLONGโnamewas too long. it's giving... excessive ๐ENOENTโ there is no message queue with the given name. ghosted fr fr ๐ป
โญ ATTRIBUTES โญ
if you wanna know what these terms even mean, go peek at attributes(7). (that's the whole explanation, i'm not gatekeeping.)
and for mq_unlink() specifically:
- Interface:
mq_unlink() - Attribute: Thread safety
- Value:
MT-Safe
so yeah โ thread safe, slay, iconic, no notes ๐ฅ
๐ STANDARDS ๐
POSIX.1-2008.
๐ HISTORY ๐
POSIX.1-2001. it's been around, it's got lore, it's a main character ๐
๐ง SEE ALSO ๐ง
and that's the whole page bestie, go unlink responsibly ๐
this has been mq_unlink(3) from the Linux man-pages 6.20, dated 2026-02-08 โ k bye, love you, drink water ๐โจ๐ฆ
๐ฆ 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