.TH bcanput() "" "" "DDI/DKI Kernel Routine"
.PC "Test whether a priority band has room for a message"
.B "#include <sys/types.h>"
.B "#include <sys/stream.h>"
\fBint bcanput(\fIqueue\^\fB, \fIpriority\^\fB)\fR
\fBqueue_t *\fIqueue\^\fB; uchar_t \fIpriority\^\fB;\fR
.PP
.B bcanput()
tests whether the priority band
.I priority
within
.I queue
has room for a message.
If
.I priority
equals zero,
.B bcanput()
behaves identically to a call to
.BR canput() .
.I queue
must have a service procedure.
.PP
.B bcanput()
returns one if the queue pointed to by
.I queue
contains room for a room with a priority of
.IR priority ;
it returns zero if
.I queue
does not.
.SH "See Also"
.B
bcanputnext(),
canput(),
canputnext(),
DDI/DKI kernel routines,
putbq(),
putnext(),
queue
.R
.SH Notes
.B bcanput()
has base or interrupt level.
It does not sleep.
.PP
.I queue
argument cannot reference field
.BR q_next .
Use
.B bcanputnext()
to perform this task.
.PP
Before you enqueue a message,
you must first call
.B canput()
to test whether
.I queue
has room for a message of the given
.IR priority ,
even if
.B bcanput()
indicates that space is available.
Do not send the message if no room is available.
.PP
Because of race conditions,
.B bcanput()
can state that
.I priority
has room for a message, but
.I priority
could be filled by another process before your process enqueues its message.
This, however, is a benign problem.
.PP
Your process cannot have the stream frozen
when it calls this function.
Your process can hold
driver-defined basic locks, read/write locks, and sleep locks
across a call to this function.
