.TH copymsg() "" "" "DDI/DKI Kernel Routine"
.PC "Duplicate a message"
.B "#include <sys/stream.h>"
\fBmblk_t *copymsg(\fImsgptr\^\fB)\fR
\fBmblk_t *\fImsgptr\^\fB;\fR
.PP
.B copymsg()
duplicates the message to which
.I msgptr
points.
It allocates enough message blocks to hold the message and calls
.B copyb()
to copy the message.
.PP
If all goes well,
.B copymsg()
returns a pointer to the duplicate message.
Otherwise, it returns NULL.
.SH "See Also"
.B
allocb(),
copyb(),
DDI/DKI kernel routines,
msgb
.R
.SH Notes
.B copymsg()
has base or interrupt level.
It does not sleep.
.PP
A driver can hold
driver-defined basic locks, read/write locks, and sleep locks
across a call to this function.
