blob: 35f212b157fc2868827de9df271806529de33905 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef __LINUX__AIO_ABI_H
8#define __LINUX__AIO_ABI_H
9#include <linux/types.h>
Christopher Ferris1308ad32017-11-14 17:32:13 -080010#include <linux/fs.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070011#include <asm/byteorder.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070012typedef __kernel_ulong_t aio_context_t;
13enum {
Tao Baod7db5942015-01-28 10:07:51 -080014 IOCB_CMD_PREAD = 0,
15 IOCB_CMD_PWRITE = 1,
Tao Baod7db5942015-01-28 10:07:51 -080016 IOCB_CMD_FSYNC = 2,
17 IOCB_CMD_FDSYNC = 3,
Christopher Ferrisa981e2e2018-10-25 12:11:39 -070018 IOCB_CMD_POLL = 5,
Tao Baod7db5942015-01-28 10:07:51 -080019 IOCB_CMD_NOOP = 6,
20 IOCB_CMD_PREADV = 7,
Tao Baod7db5942015-01-28 10:07:51 -080021 IOCB_CMD_PWRITEV = 8,
Ben Cheng655a7c02013-10-16 16:09:24 -070022};
23#define IOCB_FLAG_RESFD (1 << 0)
Christopher Ferrisa981e2e2018-10-25 12:11:39 -070024#define IOCB_FLAG_IOPRIO (1 << 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070025struct io_event {
Tao Baod7db5942015-01-28 10:07:51 -080026 __u64 data;
27 __u64 obj;
28 __s64 res;
29 __s64 res2;
Ben Cheng655a7c02013-10-16 16:09:24 -070030};
Christopher Ferris1308ad32017-11-14 17:32:13 -080031struct iocb {
32 __u64 aio_data;
Elliott Hughes8cb52b02013-11-21 13:43:23 -080033#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN)
Christopher Ferris1308ad32017-11-14 17:32:13 -080034 __u32 aio_key;
35 __kernel_rwf_t aio_rw_flags;
Tao Baod7db5942015-01-28 10:07:51 -080036#elif defined(__BYTE_ORDER)?__BYTE_ORDER==__BIG_ENDIAN:defined(__BIG_ENDIAN)
Christopher Ferris1308ad32017-11-14 17:32:13 -080037 __kernel_rwf_t aio_rw_flags;
38 __u32 aio_key;
Ben Cheng655a7c02013-10-16 16:09:24 -070039#else
Tao Baod7db5942015-01-28 10:07:51 -080040#error edit for your odd byteorder .
Ben Cheng655a7c02013-10-16 16:09:24 -070041#endif
Tao Baod7db5942015-01-28 10:07:51 -080042 __u16 aio_lio_opcode;
Tao Baod7db5942015-01-28 10:07:51 -080043 __s16 aio_reqprio;
44 __u32 aio_fildes;
45 __u64 aio_buf;
46 __u64 aio_nbytes;
Tao Baod7db5942015-01-28 10:07:51 -080047 __s64 aio_offset;
48 __u64 aio_reserved2;
49 __u32 aio_flags;
50 __u32 aio_resfd;
Ben Cheng655a7c02013-10-16 16:09:24 -070051};
52#undef IFBIG
53#undef IFLITTLE
54#endif