geteblk man page on IRIX

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



geteblk(D3)							   geteblk(D3)

NAME
     geteblk - get an empty buffer

SYNOPSIS
     #include <sys/types.h>
     #include <sys/buf.h>
     #include <sys/ddi.h>
     buf_t *geteblk(void);

DESCRIPTION
     geteblk retrieves a buffer [see buf(D4)] from the buffer cache and
     returns a pointer to the buffer header.  If a buffer is not available,
     geteblk sleeps until one is available.

   Return Values
     A pointer to the buffer header structure is returned.

USAGE
     When the driver strategy(D2) routine receives a buffer header from the
     kernel, all the necessary members are already initialized.	 However, when
     a driver allocates buffers for its own use, it must set up some of the
     members before calling its strategy routine.

     The following list describes the state of these members when the buffer
     header is received from geteblk:

	  b_flags	is set to indicate the transfer is from the user's
			buffer to the kernel.  The driver must set the B_READ
			flag if the transfer is from the kernel to the user's
			buffer.

	  b_edev	is set to NODEV and must be initialized by the driver.

	  b_bcount	is set to 1024.

	  b_un.b_addr	is set to the buffer's virtual address.

	  b_blkno	is not initialized by geteblk, and must be initialized
			by the driver

     Typically, block drivers do not allocate buffers.	The buffer is
     allocated by the kernel, and the associated buffer header is used as an
     argument to the driver strategy routine.  However, to implement some
     special features, such as ioctl(D2) commands that perform I/O, the driver
     may need its own buffer space.  The driver can get the buffer space from
     the system by using geteblk or ngeteblk(D3).  If the driver chooses to
     use its own memory for the buffer, it can allocate a buffer header only
     using getrbuf(D3).

									Page 1

geteblk(D3)							   geteblk(D3)

     Buffers allocated via geteblk must be freed using either brelse(D3) or
     biodone(D3).

   Level
     Base only.

   Synchronization Constraints
     Can sleep.

     Driver-defined basic locks and read/write locks may not be held across
     calls to this function.

     Driver-defined sleep locks may be held across calls to this function.

REFERENCES
     biodone(D3), biowait(D3), brelse(D3), buf(D4), ngeteblk(D3)

									Page 2

[top]

List of man pages available for IRIX

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]
Tweet
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