xref: /titanic_52/usr/src/uts/common/sys/aio.h (revision 1a7c1b724419d3cb5fa6eea75123c6b2060ba31b)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SYS_AIO_H
28 #define	_SYS_AIO_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 typedef struct aio_result_t {
37 	ssize_t aio_return;		/* return value of read or write */
38 	int aio_errno;		/* errno generated by the IO */
39 } aio_result_t;
40 
41 #ifdef	_SYSCALL32
42 typedef struct aio_result32_t {
43 	int aio_return;		/* return value of read or write */
44 	int aio_errno;		/* errno generated by the IO */
45 } aio_result32_t;
46 #endif /* _SYSCALL32 */
47 
48 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
49 #define	AIOREAD		0	/* opcodes for aio calls */
50 #define	AIOWRITE	1
51 #define	AIOWAIT		2
52 #define	AIOCANCEL	3
53 #define	AIONOTIFY	4
54 #define	AIOINIT		5
55 #define	AIOSTART	6
56 #define	AIOLIO		7
57 #define	AIOSUSPEND	8
58 #define	AIOERROR	9
59 #define	AIOLIOWAIT	10
60 #define	AIOAREAD	11
61 #define	AIOAWRITE	12
62 #ifdef _LARGEFILE64_SOURCE
63 #if	defined(_LP64) && !defined(_KERNEL)
64 #define	AIOLIO64	AIOLIO
65 #define	AIOSUSPEND64	AIOSUSPEND
66 #define	AIOERROR64	AIOERROR
67 #define	AIOLIOWAIT64	AIOLIOWAIT
68 #define	AIOAREAD64	AIOAREAD
69 #define	AIOAWRITE64	AIOAWRITE
70 #define	AIOCANCEL64	AIOCANCEL
71 #else
72 #define	AIOLIO64	13
73 #define	AIOSUSPEND64	14
74 #define	AIOERROR64	15
75 #define	AIOLIOWAIT64	16
76 #define	AIOAREAD64	17
77 #define	AIOAWRITE64	18
78 #define	AIOCANCEL64	19
79 #endif /* defined(_LP64) && !defined(_KERNEL) */
80 #endif /* _LARGEFILE64_SOURCE */
81 
82 #define	AIOFSYNC	20
83 #define	AIOWAITN	21
84 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
85 
86 #define	AIO_POLL_BIT	0x20	/* opcode filter for AIO_INPROGRESS */
87 #ifdef	__cplusplus
88 }
89 #endif
90 
91 #endif /* _SYS_AIO_H */
92