GETRBUF(9F) | Kernel Functions for Drivers | GETRBUF(9F) |
#include <sys/buf.h> #include <sys/kmem.h> #include <sys/ddi.h> struct buf *getrbuf(int sleepflag);
The getrbuf() function calls kmem_alloc(9F) to perform the memory allocation. kmem_alloc() 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, the driver will not sleep. In either case, a pointer to the allocated space is returned or NULL to indicate that no space was available.
Writing Device Drivers
January 27, 2015 | OmniOS |