Kernel Functions for Drivers drvpriv(9F)
NAME
drvpriv - determine driver privilege
SYNOPSIS
#include
#include
#include
int drvpriv(credt *cr);
INTERFACE LEVEL
Architecture independent level 1 (DI/DKI).
PARAMETERS
cr Pointer to the user credential structure.
DESCRIPTION
The drvpriv() function provides a general interface to the
system privilege policy. It determines whether the creden-
tials supplied by the user credential structure pointed to
by cr identify a process that has the {PRIVSYSDEVICES}
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),
adddrv(1M)) 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
The drvpriv() function can be called from user, interrupt,
or kernel context.
SEE ALSO
adddrv(1M), updatedrv(1M), privileges(5)
Writing Device Drivers
SunOS 5.11 Last change: 16 Jan 2006 1
|