2 .\" Copyright 2015 Nexenta Systems, Inc. All rights reserved.
3 .\" Copyright 1989 AT&T
4 .\" Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
5 .\" 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.
6 .\" 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.
7 .\" 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]
8 .TH GETRBUF 9F "Jan 27, 2015"
10 getrbuf \- get a raw buffer header
20 \fBstruct buf *\fR\fBgetrbuf\fR(\fBint\fR \fIsleepflag\fR);
25 Architecture independent level 1 (DDI/DKI).
32 Indicates whether driver should sleep for free space.
37 The \fBgetrbuf()\fR function allocates the space for a buffer header to the
38 caller. It is used in cases where a block driver is performing raw (character
39 interface) I/O and needs to set up a buffer header that is not associated with
43 The \fBgetrbuf()\fR function calls \fBkmem_alloc\fR(9F) to perform the memory
44 allocation. \fBkmem_alloc()\fR requires the information included in the
45 \fIsleepflag\fR argument. If \fIsleepflag\fR is set to \fBKM_SLEEP\fR, the
46 driver may sleep until the space is freed up. If \fIsleepflag\fR is set to
47 \fBKM_NOSLEEP\fR, the driver will not sleep. In either case, a pointer to the
48 allocated space is returned or \fBNULL\fR to indicate that no space was
52 The \fBgetrbuf()\fR function returns a pointer to the allocated buffer header,
53 or \fBNULL\fR if no space is available.
56 The \fBgetrbuf()\fR function can be called from user, interrupt, or kernel
57 context. (Drivers must not allow \fBgetrbuf()\fR to sleep if called from an
61 \fBbioinit\fR(9F), \fBfreerbuf\fR(9F), \fBkmem_alloc\fR(9F),
65 \fIWriting Device Drivers\fR