|MAC_ALLOC(9F)||Kernel Functions for Drivers||MAC_ALLOC(9F)|
mac_free() routines are used to allocate and free the structures used to register a device driver with mac(9E). The device driver should call
mac_alloc() with the value of
MAC_VERSIONto indicate the current version of the MAC framework that it supports. The device driver will be returned an instance of a mac_register(9S) structure which it can then use to call mac_register(9F). For more information on the order of events, see the Initializing MAC Support section of mac(9E).
When the driver is done with the
mac_register(9S) structure, it
must call the
mac_free() function to release any
memory associated with the handle.
mac_free() routines are generally called from the context of a device driver's attach(9E) entry point; however, they may be called from both user and kernel context.
mac_alloc() function will return a pointer to an allocated mac_register_t structure that can be filled in by the driver. Otherwise,
NULLis returned to indicate that the structure could not be allocated. The most common cause for this is that the value of mac_version is not supported by the kernel.
|July 22, 2019||OmniOS|