June 2025 | ||||||
Mo | Tu | We | Th | Fr | Sa | Su |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
001: /* include/linux/aio_abi.h 002: * 003: * Copyright 2000,2001,2002 Red Hat. 004: * 005: * Written by Benjamin LaHaise <bcrl@kvack.org> 006: * 007: * Distribute under the terms of the GPLv2 (see ../../COPYING) or under 008: * the following terms. 009: * 010: * Permission to use, copy, modify, and distribute this software and its 011: * documentation is hereby granted, provided that the above copyright 012: * notice appears in all copies. This software is provided without any 013: * warranty, express or implied. Red Hat makes no representations about 014: * the suitability of this software for any purpose. 015: * 016: * IN NO EVENT SHALL RED HAT BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, 017: * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF 018: * THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF RED HAT HAS BEEN ADVISED 019: * OF THE POSSIBILITY OF SUCH DAMAGE. 020: * 021: * RED HAT DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 022: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 023: * PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND 024: * RED HAT HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 025: * ENHANCEMENTS, OR MODIFICATIONS. 026: */ 027: #ifndef __LINUX__AIO_ABI_H 028: #define __LINUX__AIO_ABI_H 029: 030: #include <linux/types.h> 031: #include <asm/byteorder.h> 032: 033: typedef unsigned long aio_context_t; 034: 035: enum { 036: IOCB_CMD_PREAD = 0, 037: IOCB_CMD_PWRITE = 1, 038: IOCB_CMD_FSYNC = 2, 039: IOCB_CMD_FDSYNC = 3, 040: /* These two are experimental. 041: * IOCB_CMD_PREADX = 4, 042: * IOCB_CMD_POLL = 5, 043: */ 044: IOCB_CMD_NOOP = 6, 045: IOCB_CMD_PREADV = 7, 046: IOCB_CMD_PWRITEV = 8, 047: }; 048: 049: /* 050: * Valid flags for the "aio_flags" member of the "struct iocb". 051: * 052: * IOCB_FLAG_RESFD - Set if the "aio_resfd" member of the "struct iocb" 053: * is valid. 054: */ 055: #define IOCB_FLAG_RESFD (1 << 0) 056: 057: /* read() from /dev/aio returns these structures. */ 058: struct io_event { 059: __u64 data; /* the data field from the iocb */ 060: __u64 obj; /* what iocb this event came from */ 061: __s64 res; /* result code for this event */ 062: __s64 res2; /* secondary result */ 063: }; 064: 065: #if defined(__LITTLE_ENDIAN) 066: #define PADDED(x,y) x, y 067: #elif defined(__BIG_ENDIAN) 068: #define PADDED(x,y) y, x 069: #else 070: #error edit for your odd byteorder. 071: #endif 072: 073: /* 074: * we always use a 64bit off_t when communicating 075: * with userland. its up to libraries to do the 076: * proper padding and aio_error abstraction 077: */ 078: 079: struct iocb { 080: /* these are internal to the kernel/libc. */ 081: __u64 aio_data; /* data to be returned in event's data */ 082: __u32 PADDED(aio_key, aio_reserved1); 083: /* the kernel sets aio_key to the req # */ 084: 085: /* common fields */ 086: __u16 aio_lio_opcode; /* see IOCB_CMD_ above */ 087: __s16 aio_reqprio; 088: __u32 aio_fildes; 089: 090: __u64 aio_buf; 091: __u64 aio_nbytes; 092: __s64 aio_offset; 093: 094: /* extra parameters */ 095: __u64 aio_reserved2; /* TODO: use this for a (struct sigevent *) */ 096: 097: /* flags for the "struct iocb" */ 098: __u32 aio_flags; 099: 100: /* 101: * if the IOCB_FLAG_RESFD flag of "aio_flags" is set, this is an 102: * eventfd to signal AIO readiness to 103: */ 104: __u32 aio_resfd; 105: }; /* 64 bytes */ 106: 107: #undef IFBIG 108: #undef IFLITTLE 109: 110: #endif /* __LINUX__AIO_ABI_H */ 111: 112: