Gets message queue attributes.
Standard C Library (libc.a)
The mq_getattr subroutine obtains status information and attributes of the message queue and the open message queue description associated with the message queue descriptor.
The results are returned in the mq_attr structure referenced by the mqstat parameter.
| Item | Description |
|---|---|
| mq_curmsgs | The number of messages currently on the queue. |
| Item | Description |
|---|---|
| mqdes | Specifies a message queue descriptor. |
| mqstat | Points to the mq_attr structure. |
Upon successful completion, the mq_getattr subroutine returns zero. Otherwise, the subroutine returns -1 and sets errno to indicate the error.
| Item | Description |
|---|---|
| EBADF | The mqdes parameter is not a valid message queue descriptor. |
| EFAULT | Invalid user address. |
| EINVAL | The mqstat parameter value is not valid. |
| ENOMEM | Insufficient memory for the required operation. |
| ENOTSUP | This function is not supported with processes that have been checkpoint-restart'ed. |