Allocates message and data blocks.
The esballoc utility allocates message and data blocks that point directly to a client-supplied buffer. The esballoc utility sets the db_base, b_rptr, and b_wptr fields to the value specified in the base parameter (data buffer size) and the db_lim field to the base value plus the size value. The pointer to the free_rtn structure is placed in the db_freep field of the data block.
The success of the esballoc utility depends on the success of the allocb utility and also that the base, size, and free_rtn parameters are not null. If successful, the esballoc utility returns a pointer to a message block. If an error occurs, the esballoc utility returns a null pointer.
This utility is part of STREAMS Kernel Extensions.
Item | Description |
---|---|
base | Specifies the data buffer size. |
size | Specifies the number of bytes. |
pri | Specifies the relative importance of this block to the module.
The possible values are:
The pri parameter is currently unused and is maintained only for compatibility with applications developed prior to UNIX System V Release 4.0. |
free_rtn | Specifies the function and argument to be called when the message is freed. |
On successful completion, the esballoc utility returns a pointer to a message block. Otherwise, it returns a null pointer.