aio.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef _AIO_H
  2. #define _AIO_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <features.h>
  7. #include <signal.h>
  8. #include <time.h>
  9. #define __NEED_ssize_t
  10. #define __NEED_off_t
  11. #include <bits/alltypes.h>
  12. struct aiocb {
  13. int aio_fildes, aio_lio_opcode, aio_reqprio;
  14. volatile void *aio_buf;
  15. size_t aio_nbytes;
  16. struct sigevent aio_sigevent;
  17. void *__td;
  18. int __lock[2];
  19. volatile int __err;
  20. ssize_t __ret;
  21. off_t aio_offset;
  22. void *__next, *__prev;
  23. char __dummy4[32-2*sizeof(void *)];
  24. };
  25. #define AIO_CANCELED 0
  26. #define AIO_NOTCANCELED 1
  27. #define AIO_ALLDONE 2
  28. #define LIO_READ 0
  29. #define LIO_WRITE 1
  30. #define LIO_NOP 2
  31. #define LIO_WAIT 0
  32. #define LIO_NOWAIT 1
  33. int aio_read(struct aiocb *);
  34. int aio_write(struct aiocb *);
  35. int aio_error(const struct aiocb *);
  36. ssize_t aio_return(struct aiocb *);
  37. int aio_cancel(int, struct aiocb *);
  38. int aio_suspend(const struct aiocb *const [], int, const struct timespec *);
  39. int aio_fsync(int, struct aiocb *);
  40. int lio_listio(int, struct aiocb *__restrict const *__restrict, int, struct sigevent *__restrict);
  41. #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
  42. #define aiocb64 aiocb
  43. #define aio_read64 aio_read
  44. #define aio_write64 aio_write
  45. #define aio_error64 aio_error
  46. #define aio_return64 aio_return
  47. #define aio_cancel64 aio_cancel
  48. #define aio_suspend64 aio_suspend
  49. #define aio_fsync64 aio_fsync
  50. #define lio_listio64 lio_listio
  51. #define off64_t off_t
  52. #endif
  53. #ifdef __cplusplus
  54. }
  55. #endif
  56. #endif