[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    drv_priv(9F) manual page Table of Contents

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);

Interface Level

Architecture independent level 1 (DDI/DKI).

Arguments

cr
Pointer to the user credential structure.

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.

See Also


Table of Contents