#include <mqueue.h> int mq_getattr( mqd_t mqdes, struct mq_attr *mqstat );
EBADF
- The message queue descriptor does not refer to a valid,
open message queue.
The mqdes argument specifies a message queue descriptor. The mq_getattr function is used to get status information and attributes of the message queue associated with the message queue descriptor. The results are returned in the mq_attr structure referenced by the mqstat argument. All of these attributes are set at create time, except the blocking/non-blocking behavior of the message queue which can be dynamically set by using mq_setattr. The attribute mq_curmsg is set to reflect the number of messages on the queue at the time that mq_getattr was called.
Upon successful completion, the mq_getattr function returns zero. Otherwise, the function returns -1 and sets errno to indicate the error.
Copyright © 1988-2000 OAR Corporation