.TH ureadc() "" "" "DDI/DKI Kernel Routine"
.PC "Copy a character to space that uio describes"
.B "#include <sys/uio.h>"
\fBint ureadc(\fIc\^\fB, \fIuioptr\^\fB)\fR
\fBint \fIc\^\fB; uio_t *\fIuioptr\^\fB;\fR
.PP
.B ureadc()
copies the character
.I c
into the space described by the
.B uio
structure to which
.I uioptr
points.
.PP
.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 all goes well,
.B ureadc()
updates the appropriate fields within structures
.B uio
and
.BR iovec ,
and returns zero.
If something goes wrong,
.B ureadc()
returns an appropriate error number.
For details, see the Lexicon entries for these structures.
.SH "See Also"
.B
DDI/DKI kernel routines,
iovec,
uio,
uiomove(),
uwritec()
.R
.SH Notes
.B ureadc()
.B uio_segflg
equals
.BR UIO_USERSPACE ,
.B uread()
has base level only and can sleep; however, if it equals
.B UIO_SYSSPACE ,
.B ureadc()
has base or interrupt level and cannot sleep.
.PP
If
.B uio_segflg
equals
.BR UIO_SYSSPACE ,
a driver can hold a
driver-defined basic lock or read/write lock across a call to this function;
however, if
.B uio_segflg
equals
.BR UIO_USERSPACE ,
it cannot.
A driver can hold a sleep lock across a call to this function regardless
of the value of
.BR uio_segflg .
When it holds a lock across a call to this function, a driver must be
careful not to create a deadlock.
