STREAMS-UX Programmer's Guide (February 2007)

STREAMS Utilities Supported by HP-UX
Appendix B
229
NAME
testb () – Tests for an available buffer.
SYNOPSIS
#include <sys/stream.h>
int testb (int bufsize, unsigned int pri);
PARAMETERS
bufsize
Message buffer size in bytes.
pri
This field is obsolete.
DESCRIPTION
testb() tests if a STREAMS message of specified size can be allocated. It returns 1 if memory is available,
otherwise it returns 0. Successful return from this call does not guarantee successful memory allocation for a
subsequent allocb() call.
CONSTRAINTS
testb() can be called from thread or interrupt context. Only spinlocks of STREAMS/UX user lock order can
be held across this call.