.TH datamsg() "" "" "DDI/DKI Kernel Routine"
.PC "Test whether a message type is a data type"
.B "#include <sys/types.h>"
.B "#include <sys/stream.h>"
.B "#include <sys/ddi.h>"
\fBint datamsg(\fItype\^\fB)\fR
\fBuchar_t \fItype\^\fB;\fR
.PP
.B datamsg()
tests whether
.I type
is a data type, i.e., any of the types
.BR M_DATA ,
.BR M_DELAY ,
.BR M_PROTO ,
or
.BR M_PCPROTO .
.B datamsg()
returns one if
.I type
is a data message, and zero if it is not.
Use this function to examine field
.B db_type
within a message's
.B datab
structure, to see whether this is a data message.
To access the type of the message to which
.I msgptr
points, use the construction \fImsgptr\fB->b_datap->db_type\fR.
.SH "See Also"
.B
allocb(),
datab,
DDI/DKI kernel routines,
messages,
msgb
.R
.SH Notes
.B datamsg()
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.
