[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Communications Technical Reference, Volume 2

freeb Utility

Purpose

Frees a single message block.

Syntax

void freeb(bp)
register struct msgb *bp;

Description

The freeb utility frees (deallocate) the message-block descriptor pointed to by the bp parameter. It also frees the corresponding data block if the reference count (see the dupb utility) in the data-block descriptor (datab structure) is equal to 1. If the reference count is greater than 1, the freeb utility does not free the data block, but decrements the reference count instead.

If the reference count is 1 and if the message was allocated by the esballoc utility, the function specified by the db_frtnp->free_func pointer is called with the parameter specified by the db_frtnp->free_arg pointer.

The freeb utility cannot be used to free a multiple-block message (see the freemsg utility). Results are unpredictable if the freeb utility is called with a null argument. Always ensure that the pointer is nonnull before using the freeb utility.

Parameters

bp Contains a pointer to the message-block descriptor that is to be freed.

Implementation Specifics

This utility is part of STREAMS Kernel Extensions.

Related Information

The dupb utility, esballoc utility, freemsg utility.

List of Streams Programming References and Understanding STREAMS Messages in AIX Version 4.3 Communications Programming Concepts.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]