freeb(D3DK) —
NAME
.IX \f4freeb\fP(D3DK)
.IX STREAMS message blocks
freeb − free a message block
SYNOPSIS
#include <sys/stream.h>
void freeb(mblk_t ∗bp);
ARGUMENTS
bpPointer to the message block to be deallocated.
DESCRIPTION
freeb deallocates a message block. If the reference count of the db_ref member of the datab(D4DK) structure is greater than 1, freeb decrements the count and returns. Otherwise, if db_ref equals 1, it deallocates the message block and the corresponding data block and buffer.
If the data buffer to be freed was allocated with esballoc(D3DK), the driver is notified that the attached data buffer needs to be freed by calling the free-routine [see free_rtn(D4DK)] associated with the data buffer. Once this is accomplished, freeb releases the STREAMS resources associated with the buffer.
RETURN VALUE
None.
LEVEL
Base or Interrupt.
NOTES
Does not sleep.
Driver-defined basic locks, read/write locks, and sleep locks may be held across calls to this function.
SEE ALSO
allocb(D3DK), dupb(D3DK), esballoc(D3DK), datab(D4DK), free_rtn(D4DK), msgb(D4DK)
EXAMPLE
See copyb(D3DK) for an example of freeb.
DDI/DKI — STREAMS