Duplicates a message-block descriptor.
mblk_t * dupb(bp) register mblk_t *bp;
The dupb utility duplicates the message block descriptor (mblk_t) pointed to by the bp parameter by copying the descriptor into a newly allocated message-block descriptor. A message block is formed with the new message-block descriptor pointing to the same data block as the original descriptor. The reference count in the data-block descriptor (dblk_t) is then incremented. The dupb utility does not copy the data buffer, only the message-block descriptor.
Message blocks that exist on different queues can reference the same data block. In general, if the contents of a message block with a reference count greater than 1 are to be modified, the copymsg utility should be used to create a new message block. Only the new message block should be modified to ensure that other references to the original message block are not invalidated by unwanted changes.
bp | Contains a pointer to the message-block descriptor to be copied. |
On successful compilation, the dupb utility returns a pointer to the new message block. If the dupb utility cannot allocate a new message-block descriptor, it returns a null pointer.
This utility is part of STREAMS Kernel Extensions.
The copymsg utility, dupmsg utility.
List of Streams Programming References and Understanding STREAMS Messages in AIX Version 4.3 Communications Programming Concepts.