getrbuf man page on SmartOS

Man page or keyword search:  
man Server   16655 pages
apropos Keyword Search (all sections)
Output format
SmartOS logo
[printable version]

GETRBUF(9F)							   GETRBUF(9F)

       getrbuf - get a raw buffer header

       #include <sys/buf.h>
       #include <sys/kmem.h>
       #include <sys/ddi.h>

       struct buf *getrbuf(int sleepflag);

       Architecture independent level 1 (DDI/DKI).

		    Indicates whether driver should sleep for free space.

       The  getrbuf()  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.

       The getrbuf() function calls kmem_alloc(9F) to perform the memory allo‐
       cation.	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.

       The  getrbuf()  function	 returns  a  pointer  to  the allocated buffer
       header, or NULL if no space is available.

       The getrbuf() function can be called from user,	interrupt,  or	kernel
       context.	 (Drivers  must not allow getrbuf() to sleep if called from an
       interrupt routine.)

       bioinit(9F), freerbuf(9F), kmem_alloc(9F), kmem_free(9F)

       Writing Device Drivers

				 Jan 16, 2006			   GETRBUF(9F)

List of man pages available for SmartOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net