[Previous]
[Contents]
[Next]

mq_setattr()

set the flags for a message queue

Synopsis:

#include <mqueue.h>
int mq_setattr( mqd_t mqdes, 
                const struct mq_attr *mqstat,
                struct mq_attr *omqstat );

Description:

The mq_setattr() function is used to set the mq_flags field of the structure pointed to by mqstat for the queue specified by mqdes. If omqstat isn't NULL, then the location it references is used to store the old attribute structure.


Note: The mq_maxmsg and mq_msgsize fields of mqstat are ignored.

For information on the bits in the mq_flags field, see "Message-queue structures" in the chapter on POSIX.4 message queues.

Returns:

If the attributes are successfully changed, then 0 is returned. If not, -1 is returned, the attributes aren't changed, and errno is set.

Errors:

EBADF
mqdes doesn't represent a valid message queue.
EINVAL
This value indicates one of the following:

Classification:

POSIX 1003.4, with extensions

Safety:
Interrupt handler No
Signal handler Yes, but modifies errno
Thread Yes

Caveats:

In order to use the mq_... functions, you must:

See also:

errno, mq_close(), mq_getattr(), mq_notify(), mq_open(), mq_receive(), mq_send(), mq_unlink()

chapter on POSIX.4 message queues


[Previous]
[Contents]
[Next]