github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/aio.txt (about)

     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  
     4  include <uapi/linux/aio_abi.h>
     5  
     6  resource io_ctx[intptr]
     7  
     8  io_setup(n int32, ctx ptr[out, io_ctx])
     9  io_destroy(ctx io_ctx)
    10  io_getevents(ctx io_ctx, min_nr intptr, nr len[events], events ptr[out, array[io_event]], timeout ptr[in, timespec, opt])
    11  io_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  # NEED: kernel identifies requets by address, so pointers passed to io_submit need to be forwarded to io_cancel somehow.
    13  io_submit(ctx io_ctx, nr len[iocbpp], iocbpp ptr[in, array[ptr[in, iocb]]])
    14  io_cancel(ctx io_ctx, iocb ptr[in, iocb], res ptr[out, io_event])
    15  
    16  lio_opcode = IOCB_CMD_PREAD, IOCB_CMD_PWRITE, IOCB_CMD_FSYNC, IOCB_CMD_FDSYNC, IOCB_CMD_NOOP, IOCB_CMD_PREADV, IOCB_CMD_PWRITEV, IOCB_CMD_POLL
    17  iocb_flags = IOCB_FLAG_RESFD, IOCB_FLAG_IOPRIO
    18  
    19  io_event {
    20  	data	int64
    21  	obj	int64
    22  	res	int64
    23  	res2	int64
    24  }
    25  
    26  iocb {
    27  	aio_data	const[0, int64]
    28  	aio_key		const[0, int32]
    29  	aio_rw_flags	const[0, int32]
    30  	aio_lio_opcode	flags[lio_opcode, int16]
    31  	aio_reqprio	int16
    32  	aio_fildes	fd
    33  	aio_buf		ptr64[inout, array[int8]]
    34  	aio_nbytes	len[aio_buf, int64]
    35  	aio_offset	int64
    36  	aio_reserved2	const[0, int64]
    37  	aio_flags	flags[iocb_flags, int32]
    38  	aio_resfd	fd_event[opt]
    39  }