.TH getq() "" "" "DDI/DKI Kernel Routine"
.PC "Get the next message from a queue"
.B "#include <sys/stream.h>"
\fBmblk_t *getq(\fIqueue\^\fB)\fR
\fBqueue_t *\fIqueue\^\fB;\fR
.PP
.B getq()
returns the next message available from the top of
.IR queue .
If no message is queued, it returns NULL.
.B getq()
handles flow control, and if necessary restarts I/O that was blocked.
.SH "See Also"
.B
bcanput(),
canput(),
DDI/DKI kernel routines,
putbq(),
putq(),
qenable(),
rmvq()
.R
.SH Notes
.B getq()
has base or interrupt level.
It does not sleep.
.PP
The calling process cannot have the stream frozen when it calls this function.
.PP
A driver can hold a
driver-defined basic lock, read/write lock, or sleep locks
across a call to this function.
