mq_getattr(3c)
mq_getattr - get attributes of a message queue
As shipped in IRIX 6.5.19. Unchanged since IRIX 6.5.
NAME mq_getattr - get attributes of a message queue C SYNOPSIS #include <mqueue.h> int mq_getattr (mqd_t mqd, struct mq_attr *mqstat); DESCRIPTION mq_getattr saves the attributes and status information of the message queue named by mqd into the mq_attr structure at address mqstat. The following fields of the mq_attr structure are updated after a successful call to mq_getattr: long mq_flags; /* message queue flags */ long mq_maxmsg; /* maximum number of messages */ long mq_msgsize; /* maximum size of a message*/ long mq_curmsgs; /* number of messages currently on queue */ The fields have the following meanings: mq_flags The set of flags which may be applied to the message queue on a queue descriptor mqd basis, rather than to the queue itself. The following flags are supported: O_NONBLOCK If set, mq_send and mq_receive operations on the queue named by mqd will not block when the queue is full or empty, respectively. mq_maxmsg The maximum number of messages that can be queued at any one time. mq_send will fail, if O_NONBLOCK flag is set, or block after this many messages are queued. This attribute of the queue can be set only at time of queue creation. mq_msgsize The maximum size of a message that can be sent to or received from the queue. This attribute of the queue can be set only at the time of queue creation. mq_curmsgs The number of messages currently on the message queue. This attribute can only be queried and cannot be explicitly set. mq_getattr will fail if one or more of the following conditions are true: [EBADF] The message queue descriptor, mqd, is not valid. [EINTR] A signal interrupted the mq_getattr function call. SEE ALSO mq_open(3c), intro(3c), mq_unlink(3c), mq_receive(3c), mq_send(3c), mq_setattr(3c), mq_notify(3c) DIAGNOSTICS Upon successful completion, a value of 0 is returned and the attributes of the queue are written into the mq_attr structure pointed to by mqstat. Otherwise, a value of -1 is returned and errno is set to indicate the error.