uio man page on OpenBSD

Man page or keyword search:  
man Server   11362 pages
apropos Keyword Search (all sections)
Output format
OpenBSD logo
[printable version]

UIOMOVE(9)		     OpenBSD Kernel Manual		    UIOMOVE(9)

NAME
     uiomove - move data described by a struct uio

SYNOPSIS
     #include <sys/systm.h>

     int
     uiomove(void *buf, int n, struct uio *uio);

DESCRIPTION
     The uiomove function copies up to n bytes between the kernel-space
     address pointed to by buf and the addresses described by uio, which may
     be in user-space or kernel-space.

     The uio argument is a pointer to a struct uio as defined by <sys/uio.h>:

     struct uio {
	     struct  iovec *uio_iov; /* pointer to array of iovecs */
	     int     uio_iovcnt;     /* number of iovecs in array */
	     off_t   uio_offset;     /* offset into file this uio corresponds to */
	     size_t  uio_resid;	     /* residual i/o count */
	     enum    uio_seg uio_segflg;
	     enum    uio_rw uio_rw;
	     struct  proc *uio_procp;/* associated process or NULL */
     };

     A struct uio typically describes data in motion.  Several of the fields
     described below reflect that expectation.

     uio_iov	 Pointer to array of struct iovecs:

		 struct iovec {
			 void	 *iov_base;	 /* Base address. */
			 size_t	  iov_len;	 /* Length. */
		 };

     uio_iovcnt	 The number of iovecs in the array.

     uio_offset	 An offset into the corresponding object.

     uio_resid	 The amount of data remaining to be transferred.

     uio_segflg	 A flag indicating whether the space described is in user-
		 space (UIO_USERSPACE) or kernel-space (UIO_SYSSPACE).

     uio_rw	 A flag indicating whether data should be read into the space
		 (UIO_READ) or written from the space (UIO_WRITE).

     uio_procp	 A pointer to a process whose data area is described by the
		 structure, or which is having the I/O done on its behalf if
		 the area is in kernel-space.  uiomove itself does not use
		 this field if the area is in kernel-space, but other
		 functions that take a struct uio may depend on this
		 information.

     The value of uio->uio_rw controls whether uiomove copies data from buf to
     uio or vice versa.

     The lesser of n or uio->uio_resid bytes are copied.

     uiomove changes fields of the structure pointed to by uio, such that
     uio->uio_resid is decremented by the amount of data moved,
     uio->uio_offset is incremented by the same amount, and the array of
     iovecs is adjusted to point that much farther into the region described.
     This allows multiple calls to uiomove to easily be used to fill or drain
     the region of data.

RETURN VALUES
     uiomove returns 0 on success or EFAULT if a bad address is encountered.

SEE ALSO
     copy(9)

OpenBSD 4.9			 June 26, 2008			   OpenBSD 4.9
[top]

List of man pages available for OpenBSD

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net