Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / adjmsg.9f
blobef84bbad5402839fc2ec5050a86b4076308a4817
1 '\" te
2 .\"  Copyright 1989 AT&T
3 .\" Copyright (c) 2006, Sun Microsystems, Inc., All Rights Reserved
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH ADJMSG 9F "Jan 16, 2006"
8 .SH NAME
9 adjmsg \- trim bytes from a message
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/stream.h>
17 \fBint\fR \fBadjmsg\fR(\fBmblk_t *\fR\fImp\fR, \fBssize_t\fR \fIlen\fR);
18 .fi
20 .SH INTERFACE LEVEL
21 .sp
22 .LP
23 Architecture independent level 1 (DDI/DKI).
24 .SH PARAMETERS
25 .sp
26 .ne 2
27 .na
28 \fB\fImp\fR\fR
29 .ad
30 .RS 7n
31 Pointer to the message to be trimmed.
32 .RE
34 .sp
35 .ne 2
36 .na
37 \fB\fIlen\fR\fR
38 .ad
39 .RS 7n
40 The number of bytes to be removed.
41 .RE
43 .SH DESCRIPTION
44 .sp
45 .LP
46 The \fBadjmsg()\fR function removes bytes from a message. |\fIlen\fR| (the
47 absolute value of \fIlen\fR) specifies the number of bytes to be removed. The
48 \fBadjmsg()\fR function only trims bytes across message blocks of the same
49 type.
50 .sp
51 .LP
52 The \fBadjmsg()\fR function finds the maximal leading sequence of message
53 blocks of the same type as that of \fImp\fR and starts removing bytes either
54 from the head of that sequence or from the tail of that sequence. If \fIlen\fR
55 is greater than \fB0\fR, \fBadjmsg()\fR removes bytes from the start of the
56 first message block in that sequence. If \fIlen\fR is less than \fB0\fR, it
57 removes bytes from the end of the last message block in that sequence.
58 .sp
59 .LP
60 The \fBadjmsg()\fR function fails if |\fIlen\fR| is greater than the number of
61 bytes in the maximal leading sequence it finds.
62 .sp
63 .LP
64 The \fBadjmsg()\fR function may remove any except the first zero-length message
65 block created during adjusting. It may also remove any zero-length message
66 blocks that occur within the scope of |\fIlen\fR|.
67 .SH RETURN VALUES
68 .sp
69 .LP
70 The \fBadjmsg()\fR function returns:
71 .sp
72 .ne 2
73 .na
74 \fB\fB1\fR\fR
75 .ad
76 .RS 5n
77 Successful completion.
78 .RE
80 .sp
81 .ne 2
82 .na
83 \fB\fB0\fR\fR
84 .ad
85 .RS 5n
86 An error occurred.
87 .RE
89 .SH CONTEXT
90 .sp
91 .LP
92 The \fBadjmsg()\fR function can be called from user, interrupt, or kernel
93 context.
94 .SH SEE ALSO
95 .sp
96 .LP
97 \fISTREAMS Programming Guide\fR