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 #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 #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 #ifdef _LARGEFILE64_SOURCE 68 #if defined(_LP64) && !defined(_KERNEL) 69 #define AIOLIO64 AIOLIO 70 #define AIOSUSPEND64 AIOSUSPEND 71 #define AIOERROR64 AIOERROR 72 #define AIOLIOWAIT64 AIOLIOWAIT 73 #define AIOAREAD64 AIOAREAD 74 #define AIOAWRITE64 AIOAWRITE 75 #define AIOCANCEL64 AIOCANCEL 76 #define AIOFSYNC64 AIOFSYNC 77 #else 78 #define AIOLIO64 13 79 #define AIOSUSPEND64 14 80 #define AIOERROR64 15 81 #define AIOLIOWAIT64 16 82 #define AIOAREAD64 17 83 #define AIOAWRITE64 18 84 #define AIOCANCEL64 19 85 #define AIOFSYNC64 22 86 #endif /* defined(_LP64) && !defined(_KERNEL) */ 87 #endif /* _LARGEFILE64_SOURCE */ 88 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */ 89 90 #define AIO_POLL_BIT 0x20 /* opcode filter for AIO_INPROGRESS */ 91 92 #ifdef __cplusplus 93 } 94 #endif 95 96 #endif /* _SYS_AIO_H */ 97