/* include/linux/aio_abi.h1*2* Copyright 2000,2001,2002 Red Hat.3*4* Written by Benjamin LaHaise <[email protected]>5*6* Distribute under the terms of the GPLv2 (see ../../COPYING) or under7* the following terms.8*9* Permission to use, copy, modify, and distribute this software and its10* documentation is hereby granted, provided that the above copyright11* notice appears in all copies. This software is provided without any12* warranty, express or implied. Red Hat makes no representations about13* the suitability of this software for any purpose.14*15* IN NO EVENT SHALL RED HAT BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,16* SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF17* THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF RED HAT HAS BEEN ADVISED18* OF THE POSSIBILITY OF SUCH DAMAGE.19*20* RED HAT DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE21* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR22* PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND23* RED HAT HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,24* ENHANCEMENTS, OR MODIFICATIONS.25*/26#ifndef __LINUX__AIO_ABI_H27#define __LINUX__AIO_ABI_H2829#include <linux/types.h>30#include <asm/byteorder.h>3132typedef unsigned long aio_context_t;3334enum {35IOCB_CMD_PREAD = 0,36IOCB_CMD_PWRITE = 1,37IOCB_CMD_FSYNC = 2,38IOCB_CMD_FDSYNC = 3,39/* These two are experimental.40* IOCB_CMD_PREADX = 4,41* IOCB_CMD_POLL = 5,42*/43IOCB_CMD_NOOP = 6,44IOCB_CMD_PREADV = 7,45IOCB_CMD_PWRITEV = 8,46};4748/*49* Valid flags for the "aio_flags" member of the "struct iocb".50*51* IOCB_FLAG_RESFD - Set if the "aio_resfd" member of the "struct iocb"52* is valid.53*/54#define IOCB_FLAG_RESFD (1 << 0)5556/* read() from /dev/aio returns these structures. */57struct io_event {58__u64 data; /* the data field from the iocb */59__u64 obj; /* what iocb this event came from */60__s64 res; /* result code for this event */61__s64 res2; /* secondary result */62};6364#if defined(__LITTLE_ENDIAN)65#define PADDED(x,y) x, y66#elif defined(__BIG_ENDIAN)67#define PADDED(x,y) y, x68#else69#error edit for your odd byteorder.70#endif7172/*73* we always use a 64bit off_t when communicating74* with userland. its up to libraries to do the75* proper padding and aio_error abstraction76*/7778struct iocb {79/* these are internal to the kernel/libc. */80__u64 aio_data; /* data to be returned in event's data */81__u32 PADDED(aio_key, aio_reserved1);82/* the kernel sets aio_key to the req # */8384/* common fields */85__u16 aio_lio_opcode; /* see IOCB_CMD_ above */86__s16 aio_reqprio;87__u32 aio_fildes;8889__u64 aio_buf;90__u64 aio_nbytes;91__s64 aio_offset;9293/* extra parameters */94__u64 aio_reserved2; /* TODO: use this for a (struct sigevent *) */9596/* flags for the "struct iocb" */97__u32 aio_flags;9899/*100* if the IOCB_FLAG_RESFD flag of "aio_flags" is set, this is an101* eventfd to signal AIO readiness to102*/103__u32 aio_resfd;104}; /* 64 bytes */105106#undef IFBIG107#undef IFLITTLE108109#endif /* __LINUX__AIO_ABI_H */110111112113