GETQ(9F) Kernel Functions for Drivers GETQ(9F)
getq - get the next message from a queue
#include <sys/stream.h> mblk_t *getq
Architecture independent level 1 (DDI/DKI).
Pointer to the queue from which the message is to be retrieved.
function is used by a service ( srv(9E)
) routine to retrieve
its enqueued messages.
A module or driver may include a service routine to process enqueued
messages. Once the STREAMS
scheduler calls srv()
it must process all
enqueued messages, unless prevented by flow control. getq()
next available message from the top of the queue pointed to by q
should be called in a while
loop that is exited only when there are no
more messages or flow control prevents further processing.
If an attempt was made to write to the queue while it was blocked by flow
back-enables (restarts) the service routine once it falls
below the low water mark.
If there is a message to retrieve, getq()
returns a pointer to it. If no
message is queued, getq()
returns a NULL
function can be called from user, interrupt, or kernel
SEE ALSO srv(9E)
, qenable(9F) Writing Device Drivers STREAMS Programming Guide
January 16, 2006 GETQ(9F)