mq_destroy(3P4) — CX/UX Programmer’s Reference Manual
NAME
mq_destroy − destroy a message queue
SYNOPSIS
#include <mqueue.h>
int mq_destroy (name);
char ∗name;
DESCRIPTION
The mq_destroy function destroys the message queue named by name. After a successful call to mq_destroy with name, a call to mq_open(3P4) with name will fail if the flag O_CREAT is not set in oflag.
If one or more processes have the message queue open when mq_destroy is called, destruction of the message queue shall be postponed until all references to the message queue have been closed. The mq_destroy will not block until all references have been closed; it returns immediately. Messages in the message queue will be discarded when the message queue has been destroyed and there are no open connections to the message queue.
RETURN VALUE
Upon successful completion, the mq_destroy 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:
[ENOENT] The message queue does not exist.
[EPERM] The process does not have read and write access to the named message queue.
FILES
/usr/lib/libposix4.a
SEE ALSO
mq_open(3P4), mq_close(3P4), mq_receive(3P4), mq_send(3P4), mq_getattr(3P4), mq_notify(3P4), "CX/UX Programmer’s Guide".
WARNING
The interface to mq_destroy 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.