aio.h 1.3 KB

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