Close a message queue
#include <mqueue.h> int mq_close( mqd_t mqdes );
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Use the -l mq option to qcc to link against this library.
The mq_close() function removes the association between mqdes and a message queue. If the current process attaches a notify to this queue for notification, the attachment is eliminated. If this queue is unlinked before the call to mq_close(), and this process is the last process to call mq_close() on the queue, then the queue is destroyed, along with its contents.
|The message queue manager needs to be running. Neutrino supports two implementations of message queues: a traditional implementation, and an alternate one that uses the mq server and a queue in kernel space. For more information, see the entries for mq and mqueue in the Utilities Reference, as well as the POSIX Message Queues: Two Implementations technote.|
In the traditional (mqueue) implementation, calling close() with mqdes has the same effect as calling mq_close().
-1 if an error occurred (errno is set). Any other value indicates success.
POSIX 1003.1 MSG
mq, mqueue in the Utilities Reference
“POSIX message queues” in the “Interprocess Communication (IPC)” chapter of System Architecture
POSIX Message Queues: Two Implementations technote.