Allocates a header memory buffer from the mbuf pool.
#include <sys/types.h> #include <sys/errno.h> #include <sys/mbuf.h>
struct mbuf * m_gethdr (wait, type) int wait; int type;
wait | Specifies either the M_DONTWAIT or M_WAIT value. |
type | Specifies the valid mbuf type from the /usr/include/sys/mbuf.h file. |
The m_gethdr 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_gethdr kernel service will not return until an mbuf structure is available. Interrupt handlers should call this kernel service only with the wait parameter set to M_DONTWAIT. The M_PKTHDR flag is set for the returned mbuf structure.
The m_gethdr kernel service can be called from either the process or interrupt environment.
An interrupt handler can specify the wait parameter as M_DONTWAIT only.
The address of an allocated mbuf structure is returned on success. If the wait parameter is set to M_DONTWAIT and there are no free mbuf structure, the m_gethdr kernel service returns null.
The m_gethdr kernel service is part of Base Operating System (BOS) Runtime.
The m_free kernel service, m_freem kernel service.
I/O Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts.