copyb Utility

Purpose

Copies a message block.

Syntax

mblk_t *
copyb(bp)
register mblk_t * bp;

Description

The copyb utility copies the contents of the message block pointed to by the bp parameter into a newly allocated message block of at least the same size. The copyb utility allocates a new block by calling the allocb utility. All data between the b_rptr and b_wptr pointers of a message block are copied to the new block, and these pointers in the new block are given the same offset values they had in the original message block.

This utility is part of STREAMS Kernel Extensions.

Parameters

Item Description
bp Contains a pointer to the message block to be copied.

Return Values

On successful completion, the copyb utility returns a pointer to the new message block containing the copied data. Otherwise, it returns a null value. The copy is rounded to a fullword boundary.