DRV_PRIV(9F) Kernel Functions for Drivers DRV_PRIV(9F)
drv_priv - determine driver privilege
#include <sys/ddi.h> int drv_priv
Architecture independent level 1 (DDI/DKI).
Pointer to the user credential structure.
function provides a general interface to the system
privilege policy. It determines whether the credentials supplied by the
user credential structure pointed to by cr
identify a process that has
privilege asserted in its effective set. This
function should be used only when file access modes, special minor device
numbers, and the device policy (see privileges(5)
insufficient to provide protection for the requested driver function. It
is intended to replace all calls to suser()
and any explicit checks for
effective user ID = 0 in driver code.
This routine returns 0
if it succeeds, EPERM
if it fails.
function can be called from user, interrupt, or kernel
SEE ALSO add_drv(1M)
, privileges(5) Writing Device Drivers
January 16, 2006 DRV_PRIV(9F)