- macOS 10.5+
Blocking or non-blocking.
The type of the mbuf if mbuf is non-NULL; otherwise ignored.
Pointer to the address of the mbuf; if NULL, an mbuf will be allocated, otherwise, it must point to a valid mbuf address. If the user-supplied mbuf is already attached to a cluster, the current cluster will be freed before the mbuf gets attached to the supplied external buffer. Note that this routine may return a different mbuf_t than the one you passed in.
Address of the external buffer.
Free routine for the external buffer; the caller is required to defined a routine that will be invoked when the mbuf is freed.
Size of the external buffer.
Private value that will be passed to the free routine when it is called at the time the mbuf is freed.
0 on success EINVAL - Invalid parameter ENOMEM - Not enough memory available
Attach an external buffer as a cluster for an mbuf. If mbuf points to a NULL mbuf_t, an mbuf will be allocated for you. If mbuf points to a non-NULL mbuf_t, the user-supplied mbuf will be used instead. The caller is responsible for allocating the external buffer by calling mbuf_alloccluster().