man pages section 9: DDI and DKI Kernel Functions

Exit Print View

Updated: July 2014
 
 

dupmsg(9F)

Name

dupmsg - duplicate a message

Synopsis

#include <sys/stream.h>

mblk_t *dupmsg(mblk_t *mp);

Interface Level

Architecture independent level 1 (DDI/DKI).

Parameters

mp

Pointer to the message.

Description

dupmsg() forms a new message by copying the message block descriptors pointed to by mp and linking them. dupb(9F) is called for each message block. The data blocks themselves are not duplicated.

Return Values

If successful, dupmsg() returns a pointer to the new message block. Otherwise, it returns a NULL pointer. A return value of NULL indicates either memory depletion or the data block reference count, db_ref (see datab (9S)), has reached a limit (255). See dupb(9F).

Context

dupmsg() can be called from user, kernel, or interrupt context.

Examples

Example 1 Using dupmsg()

See copyb(9F) for an example using dupmsg().

See Also

copyb(9F), copymsg(9F), dupb(9F), datab(9S)

Writing Device Drivers for Oracle Solaris 11.2

STREAMS Programming Guide