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

m_clattach Kernel Service

Purpose

Allocates an mbuf structure and attaches an external cluster.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/mbuf.h>
struct mbuf *
m_clattach(ext_buf, ext_free, ext_size, ext_arg, wait)
caddr_t ext_buf;
int (*ext_free)();
int ext_size;
int ext_arg;
int wait;

Parameters

ext_buf Specifies the address of the external data area.
ext_free Specifies the address of a function to be called when this mbuf structure is freed.
ext_size Specifies the length of the external data area.
ext_arg Specifies an argument to pass to the above function.
wait Specifies either the M_WAIT or M_DONTWAIT value.

Description

The m_clattach kernel service allocates an mbuf structure and attaches the cluster specified by the ext_buf parameter. This data is owned by the caller. The m_data field of the returned mbuf structure points to the caller's data. Interrupt handlers can call this service only with the wait parameter set to M_DONTWAIT.

Note: The m_clattach kernel service replaces the m_clgetx kernel service, which is no longer supported.

Execution Environment

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

Return Values

The m_clattach kernel service returns the address of an allocated mbuf structure. If the wait parameter is set to M_DONTWAIT and there are no free mbuf structures, the m_clattach service returns null.

Implementation Specifics

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

Related Information

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


[ Previous | Next | Contents | Home | Search ]