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