Allocates and zeroes a memory buffer from the mbuf pool.
Item | Description |
---|---|
wait | This flag 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_getclr 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 value, the m_getclr service does not return until an mbuf structure is available.
The m_getclr kernel service differs from the m_get kernel service in that the m_getclr service zeroes the data portion of the allocated mbuf structure.
The m_getclr kernel service can be called from either the process or interrupt environment. Interrupt handlers can call the m_getclr service only with the wait parameter set to the M_DONTWAIT value.
The m_getclr kernel service returns the address of an allocated mbuf structure. If the wait parameter is set to the M_DONTWAIT value and there are no free mbuf structures, the m_getclr kernel service returns a null value.