'\"macro stdmacro
.if n .pH ddi_dki.drv_priv @(#)drv_priv	40.6 of 10/10/89
.\" Copyright 1989 AT&T
.de IX
.ie '\\n(.z'' .tm .Index: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9	\\n%
.el \\!.IX \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
..
.nr X
.if \nX=0 .ds x} drv_priv D3DK "" "DDI/DKI" "\&"
.if \nX=1 .ds x} drv_priv D3DK "" "DDI/DKI"
.if \nX=2 .ds x} drv_priv D3DK "" "\&"
.if \nX=3 .ds x} drv_priv "" "" "\&"
.TH \*(x}
.IX "\f4drv_priv\fP(D3DK)"
.SH NAME
\f4drv_priv\f1 \- determine driver privilege
.SH "SYNOPSIS" 
.nf
.na
\f4int drv_priv(cred_t *\f2cr\f4);\f1
.ad
.fi
.SH "ARGUMENT" 
.RS 0n 10
.IP "\f2*cr\f1" 10n
Pointer to the \f4cred\f1(D4DK) (credential) structure.
.RE
.SH "DESCRIPTION" 
The \f4drv_priv\f1 function provides a general interface to the
system privilege policy.  It determines whether the credentials supplied by
the \f4cred\f1 structure pointed to by \f2cr\f1 identify a priviledged
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 \f4suser()\f1 and any explicit checks for effective \f4user
ID = 0\f1 in driver code.
.SH "RETURN VALUE" 
This routine returns \f40\f1 if it succeeds,
\f4EPERM\f1 if it fails.
.SH LEVEL
Base or Interrupt
.SH "SEE ALSO" 
.na
\f4cred\f1(D4DK)
.ad
