'\"macro stdmacro
.if n .pH ddi_dki.read @(#)read	40.5 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} read D2DK "" "DDI/DKI" "\&"
.if \nX=1 .ds x} read D2DK "" "DDI/DKI"
.if \nX=2 .ds x} read D2DK "" "\&"
.if \nX=3 .ds x} read "" "" "\&"
.TH \*(x}
.IX "\f4read\fP(D2DK)"
.SH "NAME"
\f4read\f1 \- read data from a device
.SH "SYNOPSIS"
.nf
.na
\f4#include <sys/types.h>
#include <sys/errno.h>
#include <sys/open.h>
#include <sys/uio.h>
#include <sys/cred.h>
.sp 0.5
\f2prefix\f4read(\f4dev_t\f1 \f2dev, \f4uio *\f1\f2uio_p, \f4cred_t *\f1\f2cred_p\f4);\f1
.ad
.fi
.SH "ARGUMENTS"
.RS 0n
.IP "\f2dev\f1"	 10n
Device number.
.IP "\f2*uio_p\f1" 10n
Pointer to the \f4uio\f1(D4DK) structure that describes where the data
is to be stored in user space.
.IP "\f2*cred_p\f1" 10n
Pointer to the \f4cred\f1(D4DK) user credential structure for the I/O
transaction. 
.RE
.SH "DESCRIPTION"
The driver \f4read\f1 routine is called indirectly through
\f4cdevsw\f1 by the \f4read\f1(2) system call.  The \f4read\f1
routine should check the validity of the minor number component of
\f2dev\f1 and the user credentials contained in the \f4cred\f1(D4DK)
structure pointed to by \f2*cred_p\f1 (if pertinent).  The \f4read\f1
routine should supervise the data transfer into the user space
described by the \f4uio\f1(D4DK) structure. 
.SH "RETURN VALUE"
The \f4read\f1 routine should return \f40\f1 for success,
or the appropriate error number.  Refer to Appendix A for a
list of error values.
.SH "SEE ALSO"
.na
\f4write\f1(D2DK)
.ad
.if n .pH ddi_dki.segmap @(#)segmap	40.2 of 8/22/89
