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

m_get Kernel Service

Purpose

Allocates a memory buffer (mbuf) from the mbuf pool.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/mbuf.h>
struct mbuf *m_get (wait, type)
int  wait;
int  type;

Parameters

wait Indicates the action to be taken if there are no free mbuf structures. Possible values are:
M_DONTWAIT Called from either an interrupt or process environment.
M_WAIT Called from a process environment.
type Specifies a valid mbuf type, as listed in the /usr/include/sys/mbuf.h file.

Description

The m_get kernel service allocates an mbuf structure of the specified type. If the buffer pool is empty and the wait parameter is set to M_WAIT, the m_get kernel service does not return until an mbuf structure is available.

Execution Environment

The m_get 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

Upon successful completion, the m_get 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_get kernel service returns a null value.

Implementation Specifics

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

Related Information

The m_free kernel service, m_freem kernel service.

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


[ Previous | Next | Contents | Home | Search ]