struct mq_attr

Атрибуты очереди сообщений

Прототип:

#include <mqueue.h>
struct mq_attr {
long mq_maxmsg; /* maximum number of messages stored */
long mq_msgsize; /* maximum message length */
long mq_flags;
long mq_curmsgs; /* current number of messages stored */
long mq_sendwait; /* number of processes waiting to send */
long mq_recvwait; /* number of processes waiting to receive */
};

Описание:

Структура mq_attr содержит информацию об атрибутах очереди сообщений, полученных с помощью функции mq_getattr(). Структура содержит следующие поля:

mq_flags
The options set for this open message-queue description (i.e. these options are for the given mqdes, not the queue as a whole). This field may have been changed by call to mq_setattr() since you opened the queue.
O_NONBLOCK
no call to mq_receive() or mq_send() will ever block on this queue. If the queue is in such a condition that the given operation can't be performed without blocking, then an error is returned, and errno is set to EAGAIN.
mq_maxmsg
The maximum number of messages that can be stored on the queue. This value was set when the queue was created.
mq_msgsize
The maximum size of each message on the given message queue. This value was also set when the queue was created.
mq_curmsgs
The number of messages currently on the given queue.
mq_sendwait
The number of threads currently waiting to send a message. This field was eliminated from the POSIX standard after draft 9, but has been kept as a расширение ЗОСРВ «Нейтрино». A nonzero value in this field implies that the queue is full.
mq_recvwait
The number of threads currently waiting to receive a message. Like mq_sendwait, this field has been kept as a расширение ЗОСРВ «Нейтрино». A nonzero value in this field implies that the queue is empty.


Note: The alternate (mq) implementation of message queues doesn't see the non-POSIX mq_sendwait and mq_recvwait fields.

Классификация:

POSIX 1003.1 MSG

Тематические ссылки:

mq_getattr(), mq_open(), mq_setattr()




Предыдущий раздел: Описание API системной библиотеки