The Open Group Base Specifications Issue 7
IEEE Std 1003.1-2008, 2016 Edition
Copyright © 2001-2016 The IEEE and The Open Group

#### NAME

> mq_getattr - get message queue attributes (REALTIME)

#### SYNOPSIS

> ``[MSG] #include <mqueue.h>
> 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() 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.

The following sections are informative.

#### EXAMPLES

> See mq_notify.

#### APPLICATION USAGE

> None.

#### RATIONALE

> None.

#### FUTURE DIRECTIONS

> None.

#### SEE ALSO

> mq_notify, mq_open, mq_send, mq_setattr, msgctl, msgget, msgrcv, msgsnd

> 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() function is added to the SEE ALSO section for alignment with IEEE Std 1003.1d-1999.

> IEEE Std 1003.1-2001/Cor 2-2004, item XSH/TC2/D6/61 is applied, updating the ERRORS section to change the [EBADF] error from mandatory to optional.

End of informative text.

return to top of page

UNIX ® is a registered Trademark of The Open Group.
POSIX ® is a registered Trademark of The IEEE.
Copyright © 2001-2016 The IEEE and The Open Group, All Rights Reserved
[ Main Index | XBD | XSH | XCU | XRAT ]