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

unlinkb(D3str)


unlinkb -- remove a message block from the head of a message

Synopsis

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

mblk_t *unlinkb(mblk_t *mp);

Description

unlinkb removes the first message block from the message pointed to by mp.

Arguments


mp
Pointer to the message.

Return values

unlinkb returns a pointer to the remainder of the message after the first message block has been removed. If there is only one message block in the message, NULL is returned.

Usage

The removed message block is not freed. It is the caller's responsibility to free it.

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, 8, 8mp
oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

References

linkb(D3str)

Examples

The routine expects to get passed an M_PROTO T_DATA_IND message. It will remove and free the M_PROTO header and return the remaining M_DATA portion of the message.

   1  mblk_t *
   2  makedata(mp)
   3	mblk_t *mp;
   4  {
   5	mblk_t *nmp;

6 nmp = unlinkb(mp); 7 freeb(mp); 8 return(nmp); 9 }


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