Unleashed v1.4
[unleashed.git] / include / sys / aio.h
blob3c08ba42c84d1ed0a36dc5b2dbc2f0b558fd195e
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYS_AIO_H
28 #define _SYS_AIO_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
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;
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 */
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 #define AIOFSYNC 20
63 #define AIOWAITN 21
64 #define AIORESERVED1 23 /* reserved for the aio implementation */
65 #define AIORESERVED2 24
66 #define AIORESERVED3 25
67 #if defined(_LP64) && !defined(_KERNEL)
68 #define AIOLIO64 AIOLIO
69 #define AIOSUSPEND64 AIOSUSPEND
70 #define AIOERROR64 AIOERROR
71 #define AIOLIOWAIT64 AIOLIOWAIT
72 #define AIOAREAD64 AIOAREAD
73 #define AIOAWRITE64 AIOAWRITE
74 #define AIOCANCEL64 AIOCANCEL
75 #define AIOFSYNC64 AIOFSYNC
76 #else
77 #define AIOLIO64 13
78 #define AIOSUSPEND64 14
79 #define AIOERROR64 15
80 #define AIOLIOWAIT64 16
81 #define AIOAREAD64 17
82 #define AIOAWRITE64 18
83 #define AIOCANCEL64 19
84 #define AIOFSYNC64 22
85 #endif /* defined(_LP64) && !defined(_KERNEL) */
86 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
88 #define AIO_POLL_BIT 0x20 /* opcode filter for AIO_INPROGRESS */
90 #ifdef __cplusplus
92 #endif
94 #endif /* _SYS_AIO_H */