posix_aio.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * File : posix_aio.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2017, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2017/12/30 Bernard The first version.
  23. */
  24. #ifndef POSIX_AIO_H__
  25. #define POSIX_AIO_H__
  26. struct aiocb
  27. {
  28. int aio_fildes; /* File descriptor. */
  29. off_t aio_offset; /* File offset. */
  30. volatile void *aio_buf; /* Location of buffer. */
  31. size_t aio_nbytes; /* Length of transfer. */
  32. int aio_reqprio; /* Request priority offset. */
  33. struct sigevent aio_sigevent; /* Signal number and value. */
  34. int aio_lio_opcode; /* Operation to be performed. */
  35. int aio_result;
  36. struct rt_work aio_work;
  37. };
  38. int aio_cancel(int fd, struct aiocb *cb);
  39. int aio_error (const struct aiocb *cb);
  40. int aio_fsync(int op, struct aiocb *cb);
  41. int aio_read(struct aiocb *cb);
  42. ssize_t aio_return(struct aiocb *cb);
  43. int aio_suspend(const struct aiocb *const list[], int nent,
  44. const struct timespec *timeout);
  45. int aio_write(struct aiocb *cb);
  46. int lio_listio(int mode, struct aiocb * const list[], int nent,
  47. struct sigevent *sig);
  48. #endif