m_get Kernel Service
Purpose
Allocates
a memory buffer (mbuf) from the mbuf pool.
Syntax
Parameters
| Item | Description |
|---|---|
| wait | Indicates the action to be taken if there are no free mbuf structures. Possible
values are:
|
| 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.