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