m_clgetm Kernel Service

Purpose

Allocates and attaches an external buffer.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/mbuf.h>
#include <net/net_globals.h>

int
m_clgetm( m,  how,  size)
struct mbuf *m;
int  how;
int  size;

Parameters

Item Description
m Specifies the mbuf structure that the cluster will be associated with.
how Specifies either the M_DONTWAIT or M_WAIT value.
size Specifies the size of external cluster to attach. Any value less than MAXALLOCSAVE is valid. For larger values, M_WAIT must be specified.

Description

The m_clgetm service allocates an mbuf cluster of the specified number of bytes and attaches it to the mbuf structure indicated by the m parameter. If successful, the m_clgetm service sets the M_EXT flag.

Execution Environment

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

An interrupt handler can specify the wait parameter as M_DONTWAIT only.

Return Values

Item Description
1 Indicates a successful operation.

If there are no free mbuf structures, the m_clgetm kernel service returns a null value.