#include <sys/types.h> #include <sys/cred.h> #include <sys/ddi.h>int drv_priv(cred_t *cr);
Architecture independent level 1 (DDI/DKI).
drv_priv() 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 privileged process. This function should only be used when file access modes and special minor device numbers are 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.
drv_priv() can be called from user or interrupt context.