xref: /onnv-gate/usr/src/lib/libbc/inc/include/sys/uio.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * Copyright 1989 Sun Microsystems, Inc.  All rights reserved.
3*0Sstevel@tonic-gate  * Use is subject to license terms.
4*0Sstevel@tonic-gate  */
5*0Sstevel@tonic-gate 
6*0Sstevel@tonic-gate /*
7*0Sstevel@tonic-gate  * Copyright (c) 1982, 1986 Regents of the University of California.
8*0Sstevel@tonic-gate  * All rights reserved.  The Berkeley software License Agreement
9*0Sstevel@tonic-gate  * specifies the terms and conditions for redistribution.
10*0Sstevel@tonic-gate  */
11*0Sstevel@tonic-gate 
12*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
13*0Sstevel@tonic-gate 
14*0Sstevel@tonic-gate #ifndef	_sys_uio_h
15*0Sstevel@tonic-gate #define	_sys_uio_h
16*0Sstevel@tonic-gate 
17*0Sstevel@tonic-gate struct	iovec {
18*0Sstevel@tonic-gate 	caddr_t	iov_base;
19*0Sstevel@tonic-gate 	int	iov_len;
20*0Sstevel@tonic-gate };
21*0Sstevel@tonic-gate 
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate  * The uio_seg define below is obsolete and is included only
24*0Sstevel@tonic-gate  * for compatibility with previous releases.  New code should
25*0Sstevel@tonic-gate  * use the uio_segflg field.
26*0Sstevel@tonic-gate  */
27*0Sstevel@tonic-gate struct	uio {
28*0Sstevel@tonic-gate 	struct	iovec *uio_iov;
29*0Sstevel@tonic-gate 	int	uio_iovcnt;
30*0Sstevel@tonic-gate 	off_t	uio_offset;
31*0Sstevel@tonic-gate 	short	uio_segflg;
32*0Sstevel@tonic-gate #define	uio_seg	uio_segflg		/* obsolete */
33*0Sstevel@tonic-gate 	short	uio_fmode;		/* careful what you put here, the file
34*0Sstevel@tonic-gate 					 * bits that fill this are an int. */
35*0Sstevel@tonic-gate 	int	uio_resid;
36*0Sstevel@tonic-gate };
37*0Sstevel@tonic-gate 
38*0Sstevel@tonic-gate enum	uio_rw { UIO_READ, UIO_WRITE };
39*0Sstevel@tonic-gate 
40*0Sstevel@tonic-gate /*
41*0Sstevel@tonic-gate  * Segment flag values (should be enum).
42*0Sstevel@tonic-gate  *
43*0Sstevel@tonic-gate  * The UIOSEG_* defines are obsolete and are included only
44*0Sstevel@tonic-gate  * for compatibility with previous releases.  New code should
45*0Sstevel@tonic-gate  * use the UIO_* definitions.
46*0Sstevel@tonic-gate  */
47*0Sstevel@tonic-gate #define	UIO_USERSPACE	0		/* from user data space */
48*0Sstevel@tonic-gate #define	UIO_SYSSPACE	1		/* from system space */
49*0Sstevel@tonic-gate #define	UIO_USERISPACE	2		/* from user I space */
50*0Sstevel@tonic-gate 
51*0Sstevel@tonic-gate #define	UIOSEG_USER	0		/* obsolete */
52*0Sstevel@tonic-gate #define	UIOSEG_KERNEL	1		/* obsolete */
53*0Sstevel@tonic-gate 
54*0Sstevel@tonic-gate #endif	/*!_sys_uio_h*/
55