.TH canput() "" "" "DDI/DKI Kernel Routine"
.PC "Test whether a queue has room for a message"
.B "#include <sys/stream.h>"
\fBint canput(\fIqueue\^\fB)\fR
\fBqueue_t *\fIqueue\^\fB;\fR
.PP
.B canput()
tests whether
.I queue
has room for a message.
.I queue
must have a service procedure.
.PP
.B canput()
returns one if
.I queue
has room for a message; or zero if
.I queue
does not.
Do
.I not
attempt to enqueue a message on
.I queue
if
.B canput()
does not return one.
.SH "See Also"
.B
bcanput(),
bcanputnext(),
canputnext(),
DDI/DKI kernel routines,
putbq(),
putnext(),
queue
.R
.SH Notes
.B canput()
has base or interrupt level.
It does not sleep.
.PP
A function can hold
driver-defined basic locks, read/write locks, and sleep locks
across a call to this function.
.PP
Note that
.B canput()
can indicate that
.I queue
has room for a message, but another message can fill
.I queue
before your process enqueues its message.
.PP
You cannot have the stream frozen when you call this function.
.PP
.I queue
cannot reference field
.BR q_next .
To examine the queue next to
.IR queue ,
call
.BR canputnext() .
