m_copy Macro for mbuf Kernel Services

Purpose

Creates a copy of all or part of a list of mbuf structures.

Syntax

#include <sys/mbuf.h>

struct mbuf *m_copy ( m,  off,  len)
struct mbuf *m;
int off;
int len;

Parameters

Item Description
m Specifies the mbuf structure, or the head of a list of mbuf structures, to be copied.
off Specifies an offset into data from which copying starts.
len Denotes the total number of bytes to copy.

Description

The m_copy macro makes a copy of the structure specified by the m parameter. The copy begins at the specified bytes (represented by the off parameter) and continues for the number of bytes specified by the len parameter. If the len parameter is set to M_COPYALL, the entire mbuf chain is copied.

Execution Environment

The m_copy macro can be called from either the process or interrupt environment.

Return Values

Upon successful completion, the address of the copied list (the mbuf structure that heads the list) is returned. If the copy fails, a value of null is returned.