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