DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5 and SCO OpenServer 5

adjmsg(D3str)


adjmsg -- trim bytes from a message

Synopsis

   #include <sys/stream.h>
   #include <sys/ddi.h>
   

int adjmsg(mblk_t *mp, int len);

Description

adjmsg removes bytes from a message.

Arguments


mp
Pointer to the message to be trimmed.

len
|len| (the absolute value of len) specifies how many bytes are to be removed. If len is greater than 0, bytes are removed from the head of the message. If len is less than 0, bytes are removed from the tail. adjmsg fails if |len| is greater than the number of bytes in mp. If len spans more than one message block in the message, the messages blocks must be the same type, or else adjmsg will fail.

Return values

If the message can be trimmed successfully, 1 is returned. Otherwise, 0 is returned.

Usage

If len is greater than the amount of data in a single message block, that message block is not freed. Rather, it is left linked in the message, and its read and write pointers are set equal to each other, indicating no data present in the block.

Context

Base or Interrupt.

Synchronization constraints

Does not block.

Driver-defined basic locks, read/write locks, and sleep locks may be held across calls to this function.

Hardware applicability

All

Version applicability

ddi: 1, 2, 3, 4, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp
oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

References

msgb(D4str)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005