aio.h 1.5 KB

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