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.

This utility is part of STREAMS Kernel Extensions.

Parameters

Item Description
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.