drv_priv(9F)
NAME
drv_priv − determine driver privilege
SYNOPSIS
#include <sys/types.h>
#include <sys/cred.h>
#include <sys/ddi.h>
int drv_priv(cred_t ∗cr);
ARGUMENTS
cr Pointer to the user credential structure.
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
DESCRIPTION
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.
RETURN VALUES
This routine returns 0 if it succeeds, EPERM if it fails.
CONTEXT
drv_priv() can be called from user or interrupt context.
Sun Microsystems — Last change: 11 Apr 1991