mq_getattr(3P4) — CX/UX Programmer’s Reference Manual
NAME
mq_getattr − get attributes of a message queue
SYNOPSIS
#include <mqueue.h>
int mq_getattr (mqdes, mqstat);
mqd_t mqdes;
struct mq_attr ∗mqstat;
DESCRIPTION
The mq_getattr() function is used to get status information and attributes associated with the message queue specified by mqdes. Upon return, the locations pointed to by mqstat will be updated according to the current state of the message queue. The following members of the mq_attr structure are attributes that are set at the time the message queue is created:
mq_maxmsg the maximum number of messages the queue can hold
mq_msgsize the maximum size of each message
The following members of the mq_attr structure reflect the current state of the message queue:
mq_curmsgs the number of messages currently in the queue
mq_sendwait the total number of processes waiting for the mq_send() function to complete
mq_rcvwait the total number of processes waiting for the mq_receive() function to complete
The mq_flags member of the mq_attr structure is currently not used.
RETURN VALUE
Upon successful completion, the mq_getattr() function returns a value of zero. If any of the following conditions occur, a value of -1 is returned, and errno is set to indicate the error:
[EBADF] The mqdes argument is not a valid message queue descriptor.
FILES
/usr/lib/libposix4.a
SEE ALSO
mq_open(3P4), mq_close(3P4), mq_destroy(3P4), mq_send(3P4), mq_receive(3P4), mq_notify(3P4), "CX/UX Programmer’s Guide".
WARNING
The interface to mq_getattr() is based on IEEE Draft Standard P1003.4/D12. This is an unapproved draft, subject to change. Use of information contained in this unapproved draft is at your own risk. This interface will change to reflect any changes made by future drafts of POSIX 1003.4.