Moves a block of data between kernel space and a space defined by a uio structure.
#include <sys/types.h> #include <sys/errno.h> #include <sys/uio.h>
int uiomove (cp, n, rw, uiop) caddr_t cp; int n; uio_rw rw; struct uio *uiop;
|cp||Specifies the address in kernel memory to or from which data is moved.|
|n||Specifies the number of bytes to move.|
|rw|| Indicates the direction of the move:
|uiop||Points to a uio structure describing the buffer used in the data transfer.|
The uiomove kernel service moves the specified number of bytes of data between kernel space and a space described by a uio structure. Device driver top halves, especially character device drivers, frequently use the uiomove service to transfer data into or out of a user area. The uio_resid and uio_iovcnt fields in the uio structure describing the data area must be greater than 0 or an error is returned.
The uiomove service moves the number of bytes of data specified by either the n or uio_resid parameter, whichever is less. If either the n or uio_resid parameter is 0, no data is moved. The uio_segflg field in the uio structure is used to indicate if the move is accessing a user- or kernel-data area, or if the caller requires cross-memory operations and has provided the required cross-memory descriptors. If a cross-memory operation is indicated, there must be a cross-memory descriptor in the uio_xmem array for each iovec element.
If the move is successful, the following fields in the uio structure are updated:
|uio_iov||Specifies the address of current iovec element to use.|
|uio_xmem||Specifies the address of the current xmem element to use.|
|uio_iovcnt||Specifies the number of remaining iovec elements.|
|uio_iovdcnt||Specifies the number of already processed iovec elements.|
|uio_offset||Specifies the character offset on the device performing the I/O.|
|uio_resid||Specifies the total number of characters remaining in the data area described by the uio structure.|
|iov_base||Specifies the address of the data area described by the current iovec element.|
|iov_len||Specifies the length of remaining data area in the buffer described by the current iovec element.|
The uiomove kernel service can be called from the process environment only.
|0||Indicates successful completion.|
|-1|| Indicates that an error occurred for one of the following conditions:
The uiomove kernel service is part of Base Operating System (BOS) Runtime.
The uphysio kernel service, ureadc kernel service, uwritec kernel service.
The uio structure.
Memory Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts.