DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5

uiomove(D3)


uiomove -- copy data using uio structure

Synopsis

   #include <sys/types.h>
   #include <sys/uio.h>
   #include <sys/ddi.h>
   

int uiomove(void * addr, long nbytes, uio_rw_t rwflag, uio_t *uiop);

Description

The uiomove( ) function copies nbytes of data between the kernel address addr and the space defined by the uio(D4) structure pointed to by uiop. If rwflag is UIO_READ, the data is copied from addr to the space described by the uio structure. If rwflag is UIO_WRITE, the data is copied from the space described by the uio structure to addr.

Arguments


addr
Source/destination kernel address of the copy.

nbytes
Number of bytes to copy.

rwflag
Flag indicating read or write operation. Valid values are UIO_READ and UIO_WRITE.

uiop
Pointer to the uio structure for the copy.

Return values

uiomove returns 0 on success or an error number on failure.

Usage

The uio_segflg member of the uio structure specifies the type of space described by the uio structure. If uio_segflg is set to UIO_SYSSPACE, the uio structure describes a portion of the kernel address space. If uio_segflg is set to UIO_USERSPACE, the uio structure describes a portion of the user address space.

If the copy is successful, uiomove( ) updates the appropriate members of the uio and iovec(D4) structures to reflect the copy: (uio_offset and iov_base are increased by nbytes and uio_resid and iov_len are decreased by nbytes).

Context and synchronization

User context only if uio_segflg is set to UIO_USERSPACE.

Non-blockable, interrupt, user, or blockable context if uio_segflg is set to UIO_SYSSPACE.

Warnings

If addr specifies an address in user space or if the value of uio_segflg is not consistent with the type of address space described by the uio structure, the system can panic.

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.

Hardware applicability

All

Version applicability

ddi: 1, 2, 3, 4, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp

References

bcopy(D3), copyin(D3), copyout(D3), ureadc(D3), uwritec(D3), iovec(D4) uio(D4)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005