STREAMS-UX Programmer's Guide (February 2007)
STREAMS Utilities Supported by HP-UX
Appendix B
153
NAME
allocb () – Attempts to allocate a new message block.
SYNOPSIS
#include <sys/stream.h>
mblk_t *allocb (int size, int pri);
ARGUMENTS
size
The number of bytes in the message block.
pri
This field is no longer in use. It is provided for portability.
DESCRIPTION
The allocb() utility tries to allocate a message block with the requested data buffer. If the memory is not
available, it will return with a NULL pointer.
RETURN VALUES
On success, allocb() returns a pointer to a message block of type M_DATA containing the data buffer of the
requested size. On failure to allocate message block, it returns NULL pointer. The bufcall() can be used to
recover from allocb() failures.
CONSTRAINTS
allocb() can be called from thread or interrupt context. Spinlocks of STREAMS/UX user lock order can be
held across this call.