.TH putbq() "" "" "DDI/DKI Kernel Routine"
.PC "Place a message at the head of a queue"
.B "#include <sys/stream.h>"
\fBint putbq(\fIqueue\^\fB, \fImessage\^\fB)\fR
\fBqueue_t *\fIqueue\^\fB, mblk_t *\fImessage\^\fB;\fR
.PP
.B putbq()
places
.I message
at the head of
.IR queue .
If
.I queue
contains a message whose priority exceeds that of
.IR message ,
.B putbq()
places
.I message
at the head of the appropriate priority band.
A driver usually calls
.B putbq()
when
.B bcanputnext()
or
.B canputnext()
indicates that
.I message
cannot be passed to the next stream component.
.PP
.B putbq()
updates all flow-control parameters.
It schedules
.IR queue 's
service routine if it had not been disabled by a previous call to
.BR noenable() .
.PP
If all goes well,
.B putbq()
returns one.
Otherwise, it returns zero.
.SH "See Also"
.B
bcanputnext(),
canputnext(),
DDI/DKI kernel routines,
getq(),
insq(),
msgb,
putq(),
queue,
rmvq()
.R
.SH Notes
.B putbq()
has base or interrupt level.
It does not sleep.
.PP
A driver can hold a
driver-defined basic lock, read/write lock, or sleep lock
across a call to this function.
.PP
The caller cannot have the stream frozen when calling this function.
.PP
.B putbq()
can fail if insufficient memory is available to allocate the accounting
data structures used with messages whose priority bands are greater than zero.
.PP
A high-priority message should never be placed onto a queue from within
a service routine.
