.TH adjmsg() "" "" "DDI/DKI Kernel Routine"
.PC "Clip a message"
.B #include<sys/stream.h>
\fBint adjmsg(\fImsgptr\^\fB, \fIlength\^\fB)\fR
\fBmblk_t *\fImsgptr\^\fB;\fR
\fBint \fIlength\^\fB;
.PP
.B adjmsg()
trims
.I length
bytes from from the message to which
.I msgptr
points.
If
.I length
is greater than zero,
.B adjmsg()
trims the beginning of the message;
if it is less than zero,
.B adjmsg()
trims the end.
.PP
If all goes well,
.B adjmsg()
returns one.
It fails and returns zero if either of the following conditions occurs:
.IP \fB1.\fR 0.3i
The absolute value of
.I length
exceeds the number of bytes to which
.I msgptr
points.
.IP \fB2.\fR
.I length
spans more than one message block, but the message's blocks are not all of
the same type.
.SH "See Also"
.B
DDI/DKI kernel routines,
msgb
.R
.SH Notes
.B adjmsg()
has base or interrupt level.
It does not sleep.
An application can hold
driver-defined basic locks, read/write locks, and sleep locks
across calls to this function.
.PP
If
.I length
exceeds the amount of data in a message block,
.B adjmsg()
sets the block's read and write pointers equal to each other
to indicate that the block contains no data.
It does not free the block.
