Set a queue's attributes
#include <mqueue.h> int mq_setattr( mqd_t mqdes, const struct mq_attr* mqstat, struct mq_attr* omqstat );
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_setattr() function sets the mq_flags field for the specified queue (passed as the mq_flags field in mqstat). If omqstat isn't NULL, then the old attribute structure is stored in the location that it points to.
![]() |
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. |
This function ignores the mq_maxmsg, mq_msgsize, and mq_curmsgs fields of mqstat. The mq_flags field is the bitwise OR of zero or more of the following constants:
![]() |
The settings that you make for mq_flags apply only to the given message-queue description (i.e., locally), not to the queue itself. |
-1 if the function couldn't change the attributes (errno is set). Any other value indicates success.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
mq_getattr(), mq_open(), mq_receive(), mq_send()
mq, mqueue in the Utilities Reference
“POSIX message queues” in the “Interprocess Communication (IPC)” chapter of System Architecture