[Previous] [Contents] [Next]

mq_setattr()

Set a queue's attributes

Synopsis:

#include <mqueue.h>

int mq_setattr( mqd_t mqdes, 
                const struct mq_attr* mqstat,
                struct mq_attr* omqstat );

Library:

libc

Description:

The mq_setattr() function is used to set 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 mq_maxmsg and mq_msgsize fields of mqstat are ignored. The mq_flags field is the bit-wise OR of zero or more of the following constants:


Note: The following constant is specified by POSIX 1003.1b.

O_NONBLOCK
No mq_receive() or mq_send() will ever block on this queue. If the queue is in such a condition that the given operation cannot be performed without blocking, then an error is returned, and errno is set to EAGAIN.

Returns:

-1
The attributes aren't changed, and errno is set.
Any other value
The attributes are successfully changed.

Errors:

EBADF
Invalid message queue mqdes.

Classification:

POSIX 1003.1 (Realtime Extensions)

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

See also:

mq_open()


[Previous] [Contents] [Next]