aio.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #ifndef __AIO_H__
  12. #define __AIO_H__
  13. #include <stdio.h>
  14. #include <sys/signal.h>
  15. #include <rtdevice.h>
  16. struct aiocb
  17. {
  18. int aio_fildes; /* File descriptor. */
  19. off_t aio_offset; /* File offset. */
  20. volatile void *aio_buf; /* Location of buffer. */
  21. size_t aio_nbytes; /* Length of transfer. */
  22. int aio_reqprio; /* Request priority offset. */
  23. struct sigevent aio_sigevent; /* Signal number and value. */
  24. int aio_lio_opcode; /* Operation to be performed. */
  25. int aio_result;
  26. struct rt_work aio_work;
  27. };
  28. int aio_cancel(int fd, struct aiocb *cb);
  29. int aio_error (const struct aiocb *cb);
  30. int aio_fsync(int op, struct aiocb *cb);
  31. int aio_read(struct aiocb *cb);
  32. ssize_t aio_return(struct aiocb *cb);
  33. int aio_suspend(const struct aiocb *const list[], int nent,
  34. const struct timespec *timeout);
  35. int aio_write(struct aiocb *cb);
  36. int lio_listio(int mode, struct aiocb * const list[], int nent,
  37. struct sigevent *sig);
  38. #endif