.TH freeb() "" "" "DDI/DKI Kernel Routine"
.PC "Free a message block"
.B "#include <sys/stream.h>"
\fBvoid freeb(\fIbuffer\^\fB)\fR
\fBmblk_t *\fIbuffer\^\fB;\fR
.PP
.B freeb()
frees the message block to which
.I buffer
points.
If the block's reference count, as held in field
.B db_ref
of structure
.BR datab ,
is greater than one,
.B freeb()
decrements it and returns.
If
.B db_ref
equals one,
.B freeb()
deallocates the message block and the corresponding data block.
.PP
If the data buffer had been allocated by
.BR esballoc() ,
.B freeb()
frees it by invoking the free routine indicated in its copy of the structure
.BR free_rtn .
When the data buffer is freed,
.B freeb()
releases all \*(ST resources associated with the buffer,
and returns.
.SH "See Also"
.B
allocb(),
datab,
DDI/DKI kernel routines,
dupb(),
esballoc(),
free_rtn,
msgb
.R
.SH Notes
.B freeb()
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.
