Retrieves a character from a buffer described by a uio structure.
#include <sys/types.h> #include <sys/errno.h> #include <sys/uio.h>
int uwritec (uiop) struct uio *uiop;
uiop | Points to a uio structure describing the buffer from which to read a character. |
The uwritec kernel service reads a character from a buffer described by a uio structure. Device driver top half routines, especially character device drivers, frequently use the uwritec kernel service to transfer data out of a user area. The uio_resid and uio_iovcnt fields in the uio structure must be greater than 0 or an error is returned.
The uio_segflg field in the uio structure indicates whether the data is being read out of a user- or kernel-data area. This field also indicates whether the caller requires cross-memory operations and has provided the required cross-memory descriptors. The values for this flag are defined in the /usr/include/sys/uio.h file.
If the data is successfully read, the following fields in the uio structure are updated:
The uwritec kernel service can be called from the process environment only.
Upon successful completion, the uwritec service returns the character it was sent to retrieve.
-1 | Indicates that the buffer is empty or the user location is not valid for one of these three reasons: |
The uwritec kernel service is part of Base Operating System (BOS) Runtime.
The uiomove kernel service, uphysio kernel service, ureadc kernel service.