Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > M


HP-UX 11i Version 3: February 2007

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index


mq_setattr — set the blocking status of a message queue associated with a descriptor


#include <sys/mqueue.h>

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


The mq_setattr() system call changes the blocking status of a message queue associated with the descriptor, mqdes. The blocking status that is modified is per message queue descriptor and another open descriptor for the same message queue can have a different blocking status.

The argument mqstat, points to an mq_attr structure that specifies the blocking status desired. More specifically, if the O_NONBLOCK bit in the mq_flags field of the mq_attr structure is set, the descriptor is marked as non-blocking. Otherwise it is marked as blocking.

If omstat is non-NULL, mq_setattr() will store in the mq_attr structure referenced by omqstat, the previous message queue attributes and the queue blocking status associated with this mqdes. The values returned are the same as would be returned by a call to mq_getattr().

To use this function, link in the realtime library by specifying -lrt on the compiler or linker command line.


mq_setattr() returns the following values:


Successful completion.


Failure. errno is set to indicate the error.


If mq_setattr() fails, errno is set to one of the following values:


mqdes is not a valid message queue descriptor.


mqstat does not point to a valid mq_attr structure, or omqstat is non-NULL and does not point to a valid mq_attr structure.


mq_setattr() is not supported by the implementation.


mq_setattr(): POSIX 1003.1b

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.