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

Technical Reference: Communications, Volume 2


allocb Utility

Purpose

Allocates message and data blocks.

Syntax


struct msgb *
allocb(size, pri)
register int size;
uint pri;

Description

The allocb utility allocates blocks for a message. When a message is allocated in this manner, the b_band field of the mblk_t structure is initially set to a value of 0. Modules and drivers can set this field.

Parameters


size Specifies the minimum number of bytes needed in the data buffer.
pri Specifies the relative importance of the allocated blocks to the module. The possible values are:
  • BPRI_LO
  • BPRI_MED
  • BPRI_HI

Return Values

The allocb utility returns a pointer to a message block of type M_DATA in which the data buffer contains at least the number of bytes specified by the size parameter. If a block cannot be allocated as requested, the allocb utility returns a null pointer.

Implementation Specifics

This utility is part of STREAMS Kernel Extensions.

Related Information

The esballoc utility.

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


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