NAME
mq_getattr — get
message queue attributes (REALTIME)
SYNOPSIS
int mq_getattr(mqd_t mqdes, struct mq_attr *mqstat);
DESCRIPTION
The mq_getattr () function shall obtain
status information and attributes of the message queue and the open message
queue description associated with the message queue descriptor.
The mqdes argument specifies a message queue descriptor.
The results shall be returned in the mq_attr structure referenced by the mqstat argument.
Upon return, the following members shall have the values associated with the open message queue description as set when the message queue was opened and as modified by subsequent mq_setattr(3) calls: mq_flags.
The following attributes of the message queue shall be returned as set at message queue creation: mq_maxmsg, mq_msgsize.
Upon return, the following members within the mq_attr structure referenced by the mqstat argument shall be set to the current state of the message queue:
- mq_curmsgs
- The number of messages currently on the queue.
RETURN VALUE
Upon successful completion, the mq_getattr
() function shall return zero. Otherwise, the function shall return -1 and
set
errno to
indicate the error.
ERRORS
The mq_getattr () function may fail
if:
- [EBADF]
- The mqdes argument is not a valid message queue descriptor.
EXAMPLES
See mq_notify(3).
APPLICATION USAGE
None.
RATIONALE
None.
FUTURE DIRECTIONS
None.
SEE ALSO
mq_notify(3), mq_open(3), mq_send(3), mq_setattr(3), msgctl(3), msgget(3), msgrcv(3), msgsnd(3)
XBD <mqueue.h>
CHANGE HISTORY
First released in Issue 5. Included for alignment with the POSIX Realtime Extension.
Issue 6
The mq_getattr () function is marked as
part of the Message Passing option.
The [ENOSYS] error condition has been removed as stubs need not be provided if an implementation does not support the Message Passing option.
The mq_timedsend(3) function is added to the SEE ALSO section for alignment with IEEE Std 1003.1d-1999.
IEEE Std 1003.1-2001 (“POSIX.1”)/Cor 2-2004, item XSH/TC2/D6/61 is applied, updating the ERRORS section to change the [EBADF] error from mandatory to optional.