DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5 and SCO OpenServer 5

freeb(D3str)


freeb -- free a message block

Synopsis

   #include <sys/stream.h>
   #include <sys/ddi.h>
   

void freeb(mblk_t *bp);

Description

freeb deallocates a message block. If the reference count of the db_ref member of the datab(D4str) 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.

Arguments


bp
Pointer to the message block to be deallocated.

Return values

None

Usage

If the data buffer to be freed was allocated with esballoc(D3str), the driver is notified that the attached data buffer needs to be freed by calling the free_rtn(D4str) structure associated with the data buffer. Once this is accomplished, freeb releases the STREAMS resources associated with the buffer.

Context

Base or Interrupt.

Synchronization constraints

Does not block.

Driver-defined basic locks, read/write locks, and sleep locks may be held across calls to this function.

Examples

See copyb(D3str) for an example of freeb.

Hardware applicability

All

Version applicability

ddi: 1, 2, 3, 4, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp
oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

References

allocb(D3str), esballoc(D3str), datab(D4str), free_rtn(D4str), msgb(D4str)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005