Writes a character to a buffer described by a uio structure.
#include <sys/types.h> #include <sys/errno.h> #include <sys/uio.h>
int ureadc ( c, uiop)
int c;
struct uio *uiop;
c | Specifies a character to be written to the buffer. |
uiop | Points to a uio structure describing the buffer in which to place a character. |
The ureadc kernel service writes a character to a buffer described by a uio structure. Device driver top half routines, especially character device drivers, frequently use the ureadc kernel service to transfer data into a user area.
The uio_resid and uio_iovcnt fields in the uio structure describing the data area must be greater than 0. If these fields are not greater than 0, an error is returned. The uio_segflg field in the uio structure is used to indicate whether the data is being written to a user- or kernel-data area. It is also used to indicate if the caller requires cross-memory operations and has provided the required cross-memory descriptors. The values for the flag are defined in the /usr/include/sys/uio.h file.
If the data is successfully written, the following fields in the uio structure are updated:
The ureadc kernel service can be called from the process environment only.
0 | Indicates successful completion. |
ENOMEM | Indicates that there is no room in the buffer. |
EFAULT | Indicates that the user location is not valid for one of these reasons: |
The uiomove kernel service, uphysio kernel service, uwritec kernel service.
The uio structure.
Memory Kernel Services in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.