1unlinkb(9F)              Kernel Functions for Drivers              unlinkb(9F)
2
3
4

NAME

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

SYNOPSIS

9       #include <sys/stream.h>
10
11
12
13       mblk_t *unlinkb(mblk_t *mp);
14
15

INTERFACE LEVEL

17       Architecture independent level 1 (DDI/DKI).
18

PARAMETERS

20       mp    Pointer to the message.
21
22

DESCRIPTION

24       The unlinkb() function removes the first message block from the message
25       pointed to by mp. A new message, minus the removed  message  block,  is
26       returned.
27

RETURN VALUES

29       If  successful, the unlinkb() function returns a pointer to the message
30       with the first message block removed. If  there  is  only  one  message
31       block in the message, NULL is returned.
32

CONTEXT

34       The  unlinkb()  function  can be called from user, interrupt, or kernel
35       context.
36

EXAMPLES

38       Example 1 unlinkb() example
39
40
41       The routine expects to get passed an  M_PROTO  T_DATA_IND  message.  It
42       will  remove  and  free  the   M_PROTO  header and return the remaining
43       M_DATA portion of the message.
44
45
46         1  mblk_t *
47         2  makedata(mp)
48         3      mblk_t *mp;
49         4  {
50         5    mblk_t *nmp;
51         6
52         7    nmp = unlinkb(mp);
53         8    freeb(mp);
54         9    return(nmp);
55         10 }
56
57

SEE ALSO

59       linkb(9F)
60
61
62       Writing Device Drivers
63
64
65       STREAMS Programming Guide
66
67
68
69SunOS 5.11                        16 Jan 2006                      unlinkb(9F)
Impressum