[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Communications, Volume 2

esballoc Utility

Purpose

Allocates message and data blocks.

Syntax


mblk_t *
esballoc(base, size, pri, free_rtn)
unsigned char * base;
int size, pri;
frn_t * free_rtn;

Description

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.

Parameters

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:
  • BPRI_LO
  • BPRI_MED
  • BPRI_HI

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.

Return Values

On successful completion, the esballoc utility returns a pointer to a message block. Otherwise, it returns a null pointer.

Related Information

The allocb utility.

List of Streams Programming References and Understanding STREAMS Messages in AIX 5L Version 5.2 Communications Programming Concepts.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]