1adjmsg(9F) Kernel Functions for Drivers adjmsg(9F)
2
3
4
6 adjmsg - trim bytes from a message
7
9 #include <sys/stream.h>
10
11
12
13 int adjmsg(mblk_t *mp, ssize_t len);
14
15
17 Architecture independent level 1 (DDI/DKI).
18
20 mp Pointer to the message to be trimmed.
21
22
23 len The number of bytes to be removed.
24
25
27 The adjmsg() function removes bytes from a message. |len| (the absolute
28 value of len) specifies the number of bytes to be removed. The adjmsg()
29 function only trims bytes across message blocks of the same type.
30
31
32 The adjmsg() function finds the maximal leading sequence of message
33 blocks of the same type as that of mp and starts removing bytes either
34 from the head of that sequence or from the tail of that sequence. If
35 len is greater than 0, adjmsg() removes bytes from the start of the
36 first message block in that sequence. If len is less than 0, it removes
37 bytes from the end of the last message block in that sequence.
38
39
40 The adjmsg() function fails if |len| is greater than the number of
41 bytes in the maximal leading sequence it finds.
42
43
44 The adjmsg() function may remove any except the first zero-length mes‐
45 sage block created during adjusting. It may also remove any zero-length
46 message blocks that occur within the scope of |len|.
47
49 The adjmsg() function returns:
50
51 1 Successful completion.
52
53
54 0 An error occurred.
55
56
58 The adjmsg() function can be called from user, interrupt, or kernel
59 context.
60
62 STREAMS Programming Guide
63
64
65
66SunOS 5.11 16 Jan 2006 adjmsg(9F)