[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

m_copym Kernel Service

Purpose

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

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/mbuf.h>
struct mbuf *
m_copym(m, off, len, wait)
struct mbuf  m;
int  off;
int  len;
int  wait;

Parameters

m Specifies the mbuf structure to be copied.
off Specifies an offset into data from which copying will start.
len Specifies the total number of bytes to copy.
wait Specifies either the M_DONTWAIT or M_WAIT value.

Description

The m_copym kernel service makes a copy of the mbuf structure specified by the m parameter starting at the specified offset from the beginning and continuing 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.

If the mbuf structure specified by the m parameter has an external buffer attached (that is, the M_EXT flag is set), the copy is done by reference to the external cluster. In this case, the data must not be altered or both copies will be changed. Interrupt handlers can specify the wait parameter as M_DONTWAIT only.

Execution Environment

The m_copym kernel service can be called from either the process or interrupt environment.

Return Values

The address of the copy is returned upon successful completion. If the copy fails, null is returned. If the wait parameter is set to M_DONTWAIT and there are no free mbuf structures, the m_copym kernel service returns a null value.

Implementation Specifics

The m_copym kernel service is part of Base Operating System (BOS) Runtime.

Related Information

The m_copydata kernel service.

The m_copy macro.

I/O Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts.


[ Previous | Next | Contents | Home | Search ]