1# Copyright 2018 syzkaller project authors. All rights reserved. 2# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. 3 4include <uapi/linux/aio_abi.h> 5 6resource io_ctx[intptr] 7 8io_setup(n int32, ctx ptr[out, io_ctx]) 9io_destroy(ctx io_ctx) 10io_getevents(ctx io_ctx, min_nr intptr, nr len[events], events ptr[out, array[io_event]], timeout ptr[in, timespec, opt]) 11io_pgetevents(ctx io_ctx, min_nr intptr, nr len[events], events ptr[out, array[io_event]], timeout ptr[in, timespec, opt], usig ptr[in, sigset_size, opt]) 12# TODO: kernel identifies requets by address, so pointers passed to io_submit 13# need to be forwarded to io_cancel somehow. 14io_submit(ctx io_ctx, nr len[iocbpp], iocbpp ptr[in, array[ptr[in, iocb]]]) 15io_cancel(ctx io_ctx, iocb ptr[in, iocb], res ptr[out, io_event]) 16 17lio_opcode = IOCB_CMD_PREAD, IOCB_CMD_PWRITE, IOCB_CMD_FSYNC, IOCB_CMD_FDSYNC, IOCB_CMD_NOOP, IOCB_CMD_PREADV, IOCB_CMD_PWRITEV 18iocb_flags = 0, IOCB_FLAG_RESFD 19 20io_event { 21 data int64 22 obj int64 23 res int64 24 res2 int64 25} 26 27iocb { 28 aio_data const[0, int64] 29 aio_key const[0, int32] 30 aio_rw_flags const[0, int32] 31 aio_lio_opcode flags[lio_opcode, int16] 32 aio_reqprio int16 33 aio_fildes fd 34 aio_buf ptr64[inout, array[int8]] 35 aio_nbytes len[aio_buf, int64] 36 aio_offset int64 37 aio_reserved2 const[0, int64] 38 aio_flags flags[iocb_flags, int32] 39 aio_resfd fd_event 40} 41