GETRBUF(9F) Kernel Functions for Drivers GETRBUF(9F)
getrbuf - get a raw buffer header
#include <sys/ddi.h> struct buf *getrbuf
Architecture independent level 1 (DDI/DKI).
Indicates whether driver should sleep for free space.
function allocates the space for a buffer header to the
caller. It is used in cases where a block driver is performing raw
(character interface) I/O and needs to set up a buffer header that is not
associated with the buffer cache.
function calls kmem_alloc(9F)
to perform the memory
requires the information included in the sleepflag
argument. If sleepflag
is set to KM_SLEEP
, the driver may sleep
until the space is freed up. If sleepflag
is set to KM_NOSLEEP
driver will not sleep. In either case, a pointer to the allocated space
is returned or NULL
to indicate that no space was available.
function returns a pointer to the allocated buffer header,
if no space is available.
function can be called from user, interrupt, or kernel
context. (Drivers must not allow getrbuf()
to sleep if called from an
SEE ALSO bioinit(9F)
, kmem_free(9F) Writing Device Drivers
January 27, 2015 GETRBUF(9F)