[Previous] [Contents] [Next]

mq_close()

Close a message queue

Synopsis:

#include <mqueue.h>

int mq_close( mqd_t mqdes );

Library:

libc

Description:

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, along with its contents, is destroyed.

Calling close() with mqdes has the same effect as mq_close().

Returns:

-1
An error occurred (errno is set).
Any other value
The message queue was successfully closed.

Errors:

EBADF
Invalid queue mqdes.

Classification:

POSIX 1003.1 (Realtime Extensions)

Safety:
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes

See also:

mq_open(), mq_unlink()


[Previous] [Contents] [Next]