Closes a message queue.
Standard C Library (libc.a)
#include <mqueue.h>
int mq_close (mqdes)
mqd_t mqdes;
The mq_close subroutine removes the association between the message queue descriptor, mqdes, and its message queue. The results of using this message queue descriptor after successful return from the mq_close subroutine, and until the return of this message queue descriptor from a subsequent mq_open call, are undefined.
If the process has successfully attached a notification request to the message queue through the mqdes parameter, this attachment is removed, and the message queue is available for another process to attach for notification.
Item | Description |
---|---|
mqdes | Specifies the message queue descriptor. |
Upon successful completion, the mq_close subroutine returns a zero. Otherwise, the subroutine returns a -1 and sets errno to indicate the error.
Item | Description |
---|---|
EBADF | The mqdes parameter is not a valid message queue descriptor. |
ENOMEM | Insufficient memory for the required operation. |
ENOTSUP | This function is not supported with processes that have been checkpoint-restart'ed. |