Allocates a memory buffer (mbuf) from the mbuf pool.
#include <sys/types.h> #include <sys/errno.h> #include <sys/mbuf.h>
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. |
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.
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.
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.
The m_free kernel service, m_freem kernel service.
I/O Kernel Services in AIX® Version 6.1 Kernel Extensions and Device Support Programming Concepts.