.TH uwritec() "" "" "DDI/DKI Kernel Routine"
.PC "Copy character from space described by uio structure"
.B "#include <sys/uio.h>"
\fBint uwritec(\fIc\^\fB, \fIuioptr\^\fB)\fR
\fBint \fIc\^\fB; uio_t *\fIuioptr\^\fB;\fR
.PP
.B uwritec()
copies the character
.I c
from the space described by the
.B uio
structure to which
.I uioptr
points.
.I uioptr
describes an area in either user or kernel space:
if its field
.BR uio_segflg
equals
.BR UIO_SYSSPACE ,
then it points to kernel space; whereas if the field equals
.BR UIO_USERSPACE ,
it points to the user's address space.
.PP
If it copies
.I c
successfully,
.B uwritec()
updates the appropriate members of structures
.B uio
and
.B iovec
to reflect this fact, and returns the copied character.
If something goes wrong,
.B uwritec()
returns \-1.
.SH "See Also"
.B
DDI/DKI kernel routines,
iovec,
uio,
uiomove(),
ureadc()
.R
.SH Notes
.B uwritec()
.SH Level
If
.B uio_segflg
equals
.BR UIO_USERSPACE ,
.B uwrite()
has base level only and can sleep; however, if it equals
.BR UIO_SYSSPACE ,
then
.B uwritec()
has base or interrupt level and
can sleep.
.PP
If
.B uio_segflg
equals
.BR UIO_SYSSPACE ,
then a driver can hold a
driver-defined basic lock or read/write lock over a call to this function;
however, if
.B io_segflg
equals
.BR UIO_USERSPACE ,
then it cannot.
A driver can hold a
driver-defined sleep lock regardless of the value of
.BR uio_segflg .
If a function holds a lock across a call to
.BR uwritec() ,
it must be careful not to create a deadlock.
