72 lines
2.3 KiB
Plaintext
72 lines
2.3 KiB
Plaintext
.if n .pH ddi.rm/d3/gen/uwritec @(#)uwritec 43.11 of 12/4/92
|
|
.\" Copyright 1992, 1991 UNIX System Laboratories, Inc.
|
|
.TH uwritec D3
|
|
.SH NAME
|
|
\f4uwritec\f1 \- return a character from space described by \f4uio\f1(D4) structure
|
|
.IX "\f4uwritec\fP(D3)"
|
|
.SH SYNOPSIS
|
|
.nf
|
|
.na
|
|
.ft 4
|
|
#include <sys/uio.h>
|
|
#include <sys/ddi.h>
|
|
.sp 0.4
|
|
int uwritec(uio_t *\f2uiop\fP);
|
|
.ft 1
|
|
.ad
|
|
.fi
|
|
.SS Arguments
|
|
.RS 0
|
|
.IP "\f2uiop\f1" 10n
|
|
Pointer to the \f4uio\f1 structure.
|
|
.RE
|
|
.SH DESCRIPTION
|
|
\f4uwritec\f1 copies a character from the space described by the
|
|
\f4uio\f1 structure pointed to by \f2uiop\f1 and returns the character
|
|
to the caller.
|
|
.P
|
|
The \f4uio_segflg\f1 member of the \f4uio\f1 structure specifies
|
|
the type of space from which the copy is made.
|
|
If \f4uio_segflg\f1 is set to \f4UIO_SYSSPACE\f1 the character is
|
|
copied from a kernel address.
|
|
If \f4uio_segflg\f1 is set to \f4UIO_USERSPACE\f1 the character is
|
|
copied from a user address.
|
|
.P
|
|
If the character is successfully copied, \f4uwritec\f1 updates the
|
|
appropriate members of the \f4uio\f1 and \f4iovec\f1(D4)
|
|
structures to reflect the copy (\f4uio_offset\f1 and \f4iov_base\f1
|
|
are incremented and \f4uio_resid\f1 and \f4iov_len\f1 are decremented)
|
|
and returns the character to the caller.
|
|
.SS "Return Values"
|
|
If successful, \f4uwritec\f1 returns the character.
|
|
\f4-1\f1 is returned if the space described by the \f4uio\f1 structure is
|
|
empty or there is an error.
|
|
.SH USAGE
|
|
.SS Level
|
|
Base only if \f4uio_segflg\f1 is set to \f4UIO_USERSPACE\f1.
|
|
.P
|
|
Base or Interrupt if \f4uio_segflg\f1 is set to \f4UIO_SYSSPACE\f1.
|
|
.SS "Synchronization Constraints"
|
|
May sleep if \f4uio_segflg\f1 is set to \f4UIO_USERSPACE\f1.
|
|
.P
|
|
Driver-defined basic locks and read/write locks
|
|
may be held across calls to this function if \f4uio_segflg\f1 is \f4UIO_SYSSPACE\f1
|
|
but may not be held if \f4uio_segflg\f1 is \f4UIO_USERSPACE\f1.
|
|
.P
|
|
Driver-defined sleep locks
|
|
may be held across calls to this function regardless of the value of \f4uio_segflg\f1.
|
|
.SS Warnings
|
|
When holding locks across calls to this function,
|
|
multithreaded drivers must be careful to avoid creating a deadlock.
|
|
During the data transfer, page fault resolution
|
|
might result in another I/O to the same device.
|
|
For example, this could occur if the driver controls the disk drive
|
|
used as the swap device.
|
|
.SH REFERENCES
|
|
.na
|
|
\f4iovec\fP(D4),
|
|
\f4uio\fP(D4),
|
|
\f4uiomove\fP(D3),
|
|
\f4ureadc\fP(D3)
|
|
.ad
|