1 /* 2 * Copyright (c) 2006-2021, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2017/12/30 Bernard The first version. 9 * 2024/03/26 TroyMitchelle Align comments within the aiocb structure 10 */ 11 12 #ifndef __AIO_H__ 13 #define __AIO_H__ 14 15 #include <stdio.h> 16 #include <sys/signal.h> 17 #include <rtdevice.h> 18 19 struct aiocb 20 { 21 int aio_fildes; /* File descriptor. */ 22 off_t aio_offset; /* File offset. */ 23 24 volatile void *aio_buf; /* Location of buffer. */ 25 size_t aio_nbytes; /* Length of transfer. */ 26 int aio_reqprio; /* Request priority offset. */ 27 struct sigevent aio_sigevent; /* Signal number and value. */ 28 int aio_lio_opcode; /* Operation to be performed. */ 29 30 int aio_result; 31 struct rt_work aio_work; 32 }; 33 34 int aio_cancel(int fd, struct aiocb *cb); 35 int aio_error (const struct aiocb *cb); 36 37 int aio_fsync(int op, struct aiocb *cb); 38 39 int aio_read(struct aiocb *cb); 40 ssize_t aio_return(struct aiocb *cb); 41 int aio_suspend(const struct aiocb *const list[], int nent, 42 const struct timespec *timeout); 43 int aio_write(struct aiocb *cb); 44 45 int lio_listio(int mode, struct aiocb * const list[], int nent, 46 struct sigevent *sig); 47 48 #endif 49