Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

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. 

SEE ALSO

Writing Device Drivers

SunOS 5.4  —  Last change: 11 Apr 1991

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026