Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

adjmsg(9f) [opensolaris man page]

adjmsg(9F)						   Kernel Functions for Drivers 						adjmsg(9F)

NAME
adjmsg - trim bytes from a message SYNOPSIS
#include <sys/stream.h> int adjmsg(mblk_t *mp, ssize_t len); INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI). PARAMETERS
mp Pointer to the message to be trimmed. len The number of bytes to be removed. DESCRIPTION
The adjmsg() function removes bytes from a message. |len| (the absolute value of len) specifies the number of bytes to be removed. The adjmsg() function only trims bytes across message blocks of the same type. The adjmsg() function finds the maximal leading sequence of message blocks of the same type as that of mp and starts removing bytes either from the head of that sequence or from the tail of that sequence. If len is greater than 0, adjmsg() removes bytes from the start of the first message block in that sequence. If len is less than 0, it removes bytes from the end of the last message block in that sequence. The adjmsg() function fails if |len| is greater than the number of bytes in the maximal leading sequence it finds. The adjmsg() function may remove any except the first zero-length message block created during adjusting. It may also remove any zero- length message blocks that occur within the scope of |len|. RETURN VALUES
The adjmsg() function returns: 1 Successful completion. 0 An error occurred. CONTEXT
The adjmsg() function can be called from user, interrupt, or kernel context. SEE ALSO
STREAMS Programming Guide SunOS 5.11 16 Jan 2006 adjmsg(9F)

Check Out this Related Man Page

msgpullup(9F)						   Kernel Functions for Drivers 					     msgpullup(9F)

NAME
msgpullup - concatenate bytes in a message SYNOPSIS
#include <sys/stream.h> mblk_t *msgpullup(mblk_t *mp, ssize_t len); INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI). PARAMETERS
mp Pointer to the message whose blocks are to be concatenated. len Number of bytes to concatenate. DESCRIPTION
msgpullup() concatenates and aligns the first len data bytes of the message pointed to by mp, copying the data into a new message. Any remaining bytes in the remaining message blocks will be copied and linked onto the new message. The original message is unaltered. If len equals -1, all data are concatenated. If len bytes of the same message type cannot be found, msgpullup() fails and returns NULL. RETURN VALUES
msgpullup returns the following values: Non-null Successful completion. A pointer to the new message is returned. NULL An error occurred. CONTEXT
msgpullup() can be called from user or interrupt context. SEE ALSO
srv(9E), allocb(9F), pullupmsg(9F), msgb(9S) Writing Device Drivers STREAMS Programming Guide NOTES
msgpullup() is a DKI-compliant replacement for the older pullupmsg(9F) routine. Users are strongly encouraged to use msgpullup() instead of pullupmsg(9F). SunOS 5.10 11 Nov 1996 msgpullup(9F)
Man Page

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

removing leading zero

Hi, I do have a code as follows: function deHex { if ]; then deHexDate=${1:1:$2} fi } The description given for the above code is as follows: # description: removes leading zero so value will not be recognized as hex # usage: deHex <value_parameter> <value_input_length> ... (0 Replies)
Discussion started by: risshanth
0 Replies

2. Shell Programming and Scripting

Remove first N bytes and last N bytes from a binary file on AIX.

Hi all, Does anybody know or guide me on how to remove the first N bytes and the last N bytes from a binary file? Is there any AWK or SED or any command that I can use to achieve this? Your help is greatly appreciated!! Best Regards, Naveen. (1 Reply)
Discussion started by: naveendronavall
1 Replies

3. Shell Programming and Scripting

Extract sequences of bytes from binary for differents blocks

Hello to all, I would like to search sequences of bytes inside big binary file. The bin file contains blocks of information, each block begins is estructured as follow: 1- Each block begins with the hex 32 (1 byte) and ends with FF. After the FF of the last block, it follows 33. 2- Next... (59 Replies)
Discussion started by: Ophiuchus
59 Replies

4. Shell Programming and Scripting

Average score

awk '{if(len==0){last=$4;total=$6;len=1;getline}if($4!=last){printf("%s\t%f\n", last, total/len);last=$4;total=$6;len=1}else{total+=$6;len+=1}}END{printf("%s\t%f\n", last, total/len)}' exon.txt > output.txt In the attached file I am just trying to group all the same names in column $4 and then... (2 Replies)
Discussion started by: cmccabe
2 Replies

5. UNIX for Beginners Questions & Answers

Concatenating sequence length to another file

I want to add the sequence length of File_1.fa and File _2.fa to form the form the fifth column in File_1_pos.txt and File_2_poa.txt respectively using awk and bash. Can anyone help me? Thanks Get sequence length of each file File_1.fa File_2.fa Add the sequence length to be the third... (6 Replies)
Discussion started by: Ibk
6 Replies