man pages section 9: DDI and DKI Kernel Functions

Exit Print View

Updated: July 2014
 
 

mcopymsg(9F)

Name

mcopymsg - Copy message contents into a buffer and free message

Synopsis

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

void mcopymsg(mblk_t *mp, void *buf);

Interface Level

Solaris DDI specific (Solaris DDI).

Parameters

mp

Message to be copied.

buf

Buffer in which to copy.

Description

The mcopymsg() function copies the contents of the specified message into the specified buffer. If the message consists of more than a single message block, the contents of each message block are placed consecutively into the buffer. After copying the message contents to buf, mcopymsg() frees the message mp.

The provided buffer must be large enough to accommodate the message. If the buffer is not large enough, the results are unspecified. The msgsize(9F) function can be used to calculate the total size of the message beforehand.

Return Values

None.

Context

This function can be called from user, kernel or interrupt context.

See Also

freemsg(9F), msgsize(9F)

STREAMS Programming Guide