STREAMS-UX Programmer's Guide (February 2007)

Messages
Message Structures
Chapter 3
49
The q_count field contains the total number of message bytes on the queue inclusive of all normal, banded
and high priority messages. When q_count equals or exceeds the queue’s high watermark (q_hiwat),
STREAMS marks the queue as full.
The q_flag field contains a bitmask indicating the state of the queue. It can have one or more of the following
values listed:
QREADR Defines a read queue.
QNOENB Do not enable the queue when data is placed on it.
QENAB The queue is enabled to run the service procedure.
QFULL The queue is full.
QWANTR Enable the queue when data is placed in it.
QWANTW Back enable the stream when the queue drains.
QUSE The queue is allocated and ready for use.
QBACK The queue is back-enabled.
QOLD The queue supports module or driver interface to open or close developed prior to UNIX
System V Release 4.0.
QWELDED The queues are welded.
The q_nband field indicates the number of priority bands present in the queue. The q_bandp points to the
linked lists of these priority band queues.
Using Queue Information
Not all the fields in the queue structure can directly be manipulated or accessed by the modules or drivers.
•The q_ptr field, is the only field which can directly be manipulated by drivers and modules.
•The q_minpsz, q_maxpsz, q_hiwat and q_lowat fields can be modified by the modules and drivers, but
should be done so using the STREAMS utilities like strqget ()/strqset ().
•The q_first and q_last fields pointing to the head and the tail of the message queue, q_count and
q_flag can get altered through the STREAMS utilities. The modules or drivers should not modify them
directly.
•The q_qinfo, q_next, q_other, q_bandp and q_nband fields can be read by the modules and drivers but
not changed.
•The q_link field is for STREAMS internal use only.