Allocates an mbuf structure and attaches an external cluster.
#include <sys/types.h> #include <sys/errno.h> #include <sys/mbuf.h>
struct mbuf * m_clattach(ext_buf, ext_free, ext_size, ext_arg, wait) caddr_t ext_buf; int (*ext_free)(); int ext_size; int ext_arg; int wait;
The m_clattach kernel service allocates an mbuf structure and attaches the cluster specified by the ext_buf parameter. This data is owned by the caller. The m_data field of the returned mbuf structure points to the caller's data. Interrupt handlers can call this service only with the wait parameter set to M_DONTWAIT.
Note: The m_clattach kernel service replaces the m_clgetx kernel service, which is no longer supported.
The calling function is required to fill out the mbuf structure sufficiently to support normal usage. This includes support for the DMA functions during network transmission. To support DMA functions, the ext_hasxm flag field needs to be set to true and the ext_xmemd structure needs to be filled out. For buffers allocated from the kernel pinned heap, the ext_xmemd.aspace_id field should be set to XMEM_GLOBAL.
The m_clattach kernel service can be called from either the process or interrupt environment.
The m_clattach kernel 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_clattach service returns null.
The m_clattach kernel service is part of Base Operating System (BOS) Runtime.
I/O Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts.