testb Utility

Purpose

Checks for an available buffer.

Syntax

int
testb(size, pri)
register  size;
uint  pri;

Description

The testb utility checks for the availability of a message buffer of the size specified in the size parameter without actually retrieving the buffer. A successful return value from the testb utility does not guarantee that a subsequent call to the allocb utility will succeed; for example, when an interrupt routine takes the buffers.

This utility is part of STREAMS Kernel Extensions.

Parameters

Item Description
size Specifies the buffer size.
pri Specifies the relative importance of the allocated blocks 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.

Return Values

If the buffer is available, the testb utility returns a value of 1. Otherwise, it returns a value of 0.