xref: /original-bsd/sys/sys/uio.h (revision 333da485)
1 /*
2  * Copyright (c) 1982, 1986, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)uio.h	8.2 (Berkeley) 01/04/94
8  */
9 
10 #ifndef _SYS_UIO_H_
11 #define	_SYS_UIO_H_
12 
13 struct iovec {
14 	caddr_t	iov_base;
15 	int	iov_len;
16 };
17 
18 enum	uio_rw { UIO_READ, UIO_WRITE };
19 
20 /*
21  * Segment flag values.
22  */
23 enum	uio_seg {
24 	UIO_USERSPACE,		/* from user data space */
25 	UIO_SYSSPACE,		/* from system space */
26 	UIO_USERISPACE		/* from user I space */
27 };
28 
29 struct uio {
30 	struct	iovec *uio_iov;
31 	int	uio_iovcnt;
32 	off_t	uio_offset;
33 	int	uio_resid;
34 	enum	uio_seg uio_segflg;
35 	enum	uio_rw uio_rw;
36 	struct	proc *uio_procp;
37 };
38 
39  /*
40   * Limits
41   */
42 #define UIO_MAXIOV	1024		/* max 1K of iov's */
43 #define UIO_SMALLIOV	8		/* 8 on stack, else malloc */
44 
45 #ifndef	KERNEL
46 
47 #include <sys/cdefs.h>
48 
49 __BEGIN_DECLS
50 int	readv __P((int, const struct iovec *, int));
51 int	writev __P((int, const struct iovec *, int));
52 __END_DECLS
53 
54 #endif	/* !KERNEL */
55 
56 #endif /* !_SYS_UIO_H_ */
57