Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Kernel Functions for Driversdrv_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);

INTERFACE LEVEL

 

Architecture independent level 1 (DDI/DKI).

PARAMETERS

 
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

 

Writing Device Drivers


SunOS 5.9Go To TopLast Changed 11 Apr 1991

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.