Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / unlinkb.9f
blob5c2092401cf69de55ebae10bfd672b36f1ffad28
1 '\" te
2 .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH UNLINKB 9F "Jan 16, 2006"
8 .SH NAME
9 unlinkb \- remove a message block from the head of a message
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/stream.h>
17 \fBmblk_t *\fR\fBunlinkb\fR(\fBmblk_t *\fR\fImp\fR);
18 .fi
20 .SH INTERFACE LEVEL
21 .sp
22 .LP
23 Architecture independent level 1 (DDI/DKI).
24 .SH PARAMETERS
25 .sp
26 .ne 2
27 .na
28 \fB\fImp\fR\fR
29 .ad
30 .RS 6n
31 Pointer to the message.
32 .RE
34 .SH DESCRIPTION
35 .sp
36 .LP
37 The \fBunlinkb()\fR function removes the first message block from the message
38 pointed to by \fImp\fR. A new message, minus the removed message block, is
39 returned.
40 .SH RETURN VALUES
41 .sp
42 .LP
43 If successful, the \fBunlinkb()\fR function returns a pointer to the message
44 with the first message block removed. If there is only one message block in the
45 message, \fINULL\fR is returned.
46 .SH CONTEXT
47 .sp
48 .LP
49 The \fBunlinkb()\fR function can be called from user, interrupt, or kernel
50 context.
51 .SH EXAMPLES
52 .LP
53 \fBExample 1 \fR\fBunlinkb()\fR example
54 .sp
55 .LP
56 The routine expects to get passed an \fBM_PROTO T_DATA_IND\fR message. It will
57 remove and free the  \fBM_PROTO\fR header and return the remaining
58 \fBM_DATA\fR portion of the message.
60 .sp
61 .in +2
62 .nf
63 1  mblk_t *
64 2  makedata(mp)
65 3      mblk_t *mp;
66 4  {
67 5       mblk_t *nmp;
69 7       nmp = unlinkb(mp);
70 8       freeb(mp);
71 9       return(nmp);
72 10 }
73 .fi
74 .in -2
76 .SH SEE ALSO
77 .sp
78 .LP
79 \fBlinkb\fR(9F)
80 .sp
81 .LP
82 \fIWriting Device Drivers\fR
83 .sp
84 .LP
85 \fISTREAMS Programming Guide\fR