STREAMS-UX Programmer's Guide (February 2007)

STREAMS Utilities Supported by HP-UX
Appendix B
175
NAME
freeb () – Deallocates a message block.
SYNOPSIS
#include <sys/stream.h>
void freeb (mblk_t *mp);
PARAMETERS
mp
Pointer to the message block to be deallocated.
DESCRIPTION
freeb() deallocates a message block, and if the db_ref count of the datab structure it is pointing to is
greater than 1, it decrements the db_ref count by 1 and deallocates only the message block descriptor. If the
db_ref count of the data block is 1, freeb() deallocates the message block descriptor and the data buffer.
If the message block was created via the esballoc() call, and if db_ref is 1, freeb() notifies the driver by
invoking the free_func as pointed in the free_rtn structure. It waits for the driver to complete the
free_rtn operation, and then proceeds to release the message block and data block.
RETURN VALUES
None
CONSTRAINTS
freeb() can be called from thread or interrupt context. Only spinlocks of STREAMS/UX user lock order can
be held across this call.