1
0

posix_aio.h 1.2 KB

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