'\"macro stdmacro
.if n .pH ddi_dki.useracc @(#)useracc	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} useracc D3DK "" "DDI/DKI" "\&"
.if \nX=1 .ds x} useracc D3DK "" "DDI/DKI"
.if \nX=2 .ds x} useracc D3DK "" "\&"
.if \nX=3 .ds x} useracc "" "" "\&"
.TH \*(x}
.IX "\f4useracc\fP(D3DK)"
.SH NAME
\f4useracc\f1 \- verify whether user has access to memory
.SH SYNOPSIS
.nf
.na
\f4#include <sys/types.h>
#include <sys/buf.h>
.sp 0.5
int useracc(\f4caddr_t\f1 \f2base, \f4uint\f1 \f2count, \f4int\f1 \f2access\f4);\f1
.ad
.fi
.SH "ARGUMENTS"
.RS 0n 10
.IP "\f2base\f1" 10n
The start address of the user data area
.IP "\f2count\f1" 10n
The size of the data transfer in bytes
.IP "\f2access\f1" 10n
A flag to determine whether the access is a read or write.
The defined constant \f4B_READ\f1 specifies a read from the device and
a write to memory.  This requires that the user have write access
permission for the specified data area.  The defined constant
\f4B_WRITE\f1 specifies a read from memory and a write to the device.
It requires read access permission for the data area. (\f4B_READ\f1
and \f4B_WRITE\f1 are defined in the system header file \f4sys/buf.h\f1.)
.RE
.SH DESCRIPTION
\f4useracc\f1 verifies if a user has proper access to memory.
It is not
necessary to use \f4useracc\f1 for buffered I/O (including use of the
\f4copyin\f1(D3DK) and \f4copyout\f1(D3DK) functions).
.SH RETURN VALUE
Under normal conditions,
\f41\f1 is returned.
If the user does not have the proper 
access permission to the memory specified
return \f4EFAULT\f1.
.SH LEVEL
Base Only  (Do not call from an interrupt routine)
.SH SEE ALSO
.na
\f4drv_priv\f1(D3DK)
.ad
