mq_close(3P4) — CX/UX Programmer’s Reference Manual
NAME
mq_close − close a message queue
SYNOPSIS
#include <mqueue.h>
int mq_close (mqdes);
mqd_t mqdes;
DESCRIPTION
The mq_close function 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 this mq_close will cause unpredictable results such as program aborts.
If the process has successfully attached a notification request to the message queue via this mqdes, this attachment is removed, and the message queue is available for another process to attach a notification request.
Messages in the message queue are not affected by mq_close.
RETURN VALUE
Upon successful completion, the mq_close() function returns a value of zero. If any of the following conditions occur, a value of -1 is returned, and errno is set to indicate the error:
[EBADF] The mqdes argument is not a valid message queue descriptor.
FILES
/usr/lib/libposix4.a
SEE ALSO
mq_open(3P4), mq_destroy(3P4), mq_receive(3P4), mq_send(3P4), mq_getattr(3P4), mq_notify(3P4), "CX/UX Programmer’s Guide".
WARNING
The interface to mq_close() is based on IEEE Draft Standard P1003.4/D12. This is an unapproved draft, subject to change. Use of information contained in this unapproved draft is at your own risk. This interface will change to reflect any changes made by future drafts of POSIX 1003.4.