.TH flushq() "" "" "DDI/DKI Kernel Routine"
.PC "Flush the messages on a queue"
.B "#include <sys/stream.h>"
\fBvoid flushq(\fIqueue\^\fB, \fIflag\^\fB)\fR
\fBqueue_t *\fIqueue\^\fB; int \fIflag\^\fB;\fR
.PP
.B flushq()
frees messages within
.IR queue .
.I flag
indicates the messages to flush, as follows:
.IP \fBFLUSHDATA\fR 1.0i
Flush only data messages, i.e, those with type
.BR M_DATA ,
.BR M_DELAY ,
.BR M_PROTO ,
or
.BR M_PCPROTO .
.IP \fBFLUSHALL\fR
Flush all messages.
.PP
If the number of messages within
.I queue
falls below its low-water mark, thus allowing another process to write
a message onto it,
.B flushq()
enables the nearest service procedure upstream or downstream (as approriate).
.SH "See Also"
.B
DDI/DKI kernel routines,
flushband(),
freemsg(),
put(),
putq(),
queue
.R
.SH Notes
.B flushq()
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.
