STREAMS-UX Programmer's Guide (February 2007)
STREAMS Utilities Supported by HP-UX
Appendix B
163
NAME
copymsg () – Makes a copy of a specified message.
SYNOPSIS
#include <sys/stream.h>
mblk_t *copymsg (mblk_t *mp);
PARAMETERS
mp
Pointer to message to be copied.
DESCRIPTION
This function uses the copyb() utility to allocate and then copy message blocks from the message pointed by
mp
. It then forms the new message by appropriately linking the new message blocks together via b_cont
pointer.
RETURN VALUES
copymsg() returns a pointer to the newly created message if successful, and a NULL pointer upon failure.
CONSTRAINTS
copymsg() can be called from thread or interrupt context. Only spinlocks of STREAMS/UX user lock order
can be held across this call.