Allocates a free buffer.
#include <sys/types.h> #include <sys/errno.h> #include <sys/buf.h>
struct buf *geteblk ( )
Attention: The use of the geteblk service by character device drivers is strongly discouraged. As an alternative, character device drivers can use the xmalloc service to allocate the memory space directly, or the character I/O kernel services such as the getcb or getcf services.
The geteblk kernel service allocates a buffer and buffer header and returns the address of the buffer header. If no free buffers are available, then the geteblk service waits for one to become available. Block device drivers can retrieve buffers using the geteblk service.
In the header, the b_forw, b_back, b_flags, b_bcount, b_dev, and b_un fields are used by the system and cannot be modified by the driver. The av_forw and av_back fields are available to the user of the geteblk service for keeping a chain of buffers by the user of the geteblk service. (This user could be the kernel file system or a device driver.) The b_blkno and b_resid fields can be used for any purpose.
The brelse service is used to free this type of buffer.
The geteblk service has no parameters.
The geteblk kernel service can be called from the process environment only.
The geteblk service returns a pointer to the buffer header. There are no error codes because the geteblk service waits until a buffer header becomes available.
The geteblk kernel service is part of Base Operating System (BOS) Runtime.
The brelse kernel service, xmalloc kernel service.
Block I/O Buffer Cache Kernel Services: Overview, I/O Kernel Services, buf Structure, Device Driver Concepts Overview in AIX Kernel Extensions and Device Support Programming Concepts.