14b111a88SDavid Reid /* uio.h */ 24b111a88SDavid Reid 34b111a88SDavid Reid #ifndef _SYS_UIO_H 44b111a88SDavid Reid #define _SYS_UIO_H 54b111a88SDavid Reid 6*9fc71646Sbeveloper #include <sys/types.h> 74b111a88SDavid Reid 84b111a88SDavid Reid typedef struct iovec { 94b111a88SDavid Reid void *iov_base; 104b111a88SDavid Reid size_t iov_len; 114b111a88SDavid Reid } iovec; 124b111a88SDavid Reid 134b111a88SDavid Reid 144b111a88SDavid Reid #ifdef _KERNEL_MODE 154b111a88SDavid Reid enum uio_rw { UIO_READ, UIO_WRITE }; 164b111a88SDavid Reid 174b111a88SDavid Reid /* Segment flag values. */ 184b111a88SDavid Reid enum uio_seg { 194b111a88SDavid Reid UIO_USERSPACE, /* from user data space */ 204b111a88SDavid Reid UIO_SYSSPACE /* from system space */ 214b111a88SDavid Reid }; 224b111a88SDavid Reid 234b111a88SDavid Reid struct uio { 244b111a88SDavid Reid struct iovec *uio_iov; /* pointer to array of iovecs */ 254b111a88SDavid Reid int uio_iovcnt; /* number of iovecs in array */ 264b111a88SDavid Reid off_t uio_offset; /* offset into file this uio corresponds to */ 274b111a88SDavid Reid size_t uio_resid; /* residual i/o count */ 284b111a88SDavid Reid enum uio_seg uio_segflg; /* see above */ 294b111a88SDavid Reid enum uio_rw uio_rw; /* see above */ 304b111a88SDavid Reid // struct proc *uio_procp; /* process if UIO_USERSPACE */ 314b111a88SDavid Reid }; 324b111a88SDavid Reid 334b111a88SDavid Reid int uiomove(char *cp, int n, struct uio *uio); 344b111a88SDavid Reid #endif 354b111a88SDavid Reid 364b111a88SDavid Reid ssize_t readv(int fd, const struct iovec *vector, size_t count); 374b111a88SDavid Reid ssize_t readv_pos(int fd, off_t pos, const struct iovec *vec, size_t count); 384b111a88SDavid Reid ssize_t writev(int fd, const struct iovec *vector, size_t count); 394b111a88SDavid Reid ssize_t writev_pos(int fd, off_t pos, const struct iovec *vec, size_t count); 404b111a88SDavid Reid 414b111a88SDavid Reid #endif /* _SYS_UIO_H */ 42