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_getattr — get status information and attributes associated with a message queue


#include <sys/mqueue.h>

int mq_getattr(mqd_t mqdes, struct mq_attr *mqstat);


The mq_getattr() system call collects status information and attributes associated with the message queue specified by mqdes which is copied into the mq_attr structure referenced by mqstat.

Upon a successful return, the mq_msgsize and mq_maxmsg fields within the mq_attr structure contain the maximum size of a message for this queue and the maximum number of messages that can be queued at any time. The mq_curmsgs field contains the number of messages currently on the queue. In addition, the mq_flags field contains the message queue blocking status associated with this mqdes.

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


mq_getattr() returns the following values:


Successful completion.


Failure. errno is set to indicate the error.


If mq_getattr() 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.


mq_getattr() is not supported by the implementation.


mq_getattr(): 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.