getconf: don't include xpg4 bits, gcc7 includes xpg6 bits for us
[unleashed.git] / share / man / man9f / freeb.9f
blob78d0a8acd8487f4b0585d0bf221f860826a9f437
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 FREEB 9F "Jan 16, 2006"
8 .SH NAME
9 freeb \- free a message block
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/stream.h>
17 \fBvoid\fR \fBfreeb\fR(\fBmblk_t *\fR\fIbp\fR);
18 .fi
20 .SH PARAMETERS
21 .sp
22 .ne 2
23 .na
24 \fB\fIbp\fR\fR
25 .ad
26 .RS 6n
27 Pointer to the message block to be deallocated. \fBmblk_t\fR is an instance of
28 the \fBmsgb\fR(9S) structure.
29 .RE
31 .SH INTERFACE LEVEL
32 .sp
33 .LP
34 Architecture independent level 1 (DDI/DKI).
35 .SH DESCRIPTION
36 .sp
37 .LP
38 The \fBfreeb()\fR function deallocates a message block. If the reference count
39 of the \fBdb_ref\fR member of the \fBdatab\fR(9S) structure is greater than
40 \fB1\fR, \fBfreeb()\fR decrements the count. If \fBdb_ref\fR equals \fB1\fR, it
41 deallocates the message block and the corresponding data block and buffer.
42 .sp
43 .LP
44 If the data buffer to be freed was allocated with the \fBesballoc\fR(9F), the
45 buffer may be a non-STREAMS resource. In that case, the driver must be notified
46 that the attached data buffer needs to be freed, and run its own freeing
47 routine. To make this process independent of the driver used in the stream,
48 \fBfreeb()\fR finds the \fBfree_rtn\fR(9S) structure associated with the
49 buffer. The \fBfree_rtn\fR structure contains a pointer to the driver-dependent
50 routine, which releases the buffer. Once this is accomplished, \fBfreeb()\fR
51 releases the \fBSTREAMS\fR resources associated with the buffer.
52 .SH CONTEXT
53 .sp
54 .LP
55 The \fBfreeb()\fR function can be called from user, interrupt, or kernel
56 context.
57 .SH EXAMPLES
58 .LP
59 \fBExample 1 \fRUsing \fBfreeb()\fR
60 .sp
61 .LP
62 See \fBcopyb\fR(9F) for an example of using \fBfreeb()\fR.
64 .SH SEE ALSO
65 .sp
66 .LP
67 \fBallocb\fR(9F), \fBcopyb\fR(9F), \fBdupb\fR(9F), \fBesballoc\fR(9F),
68 \fBfree_rtn\fR(9S)
69 .sp
70 .LP
71 \fIWriting Device Drivers\fR
72 .sp
73 .LP
74 \fISTREAMS Programming Guide\fR