aio.h 530 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (C) 2004 Jeff Dike (jdike@karaya.com)
  3. * Licensed under the GPL
  4. */
  5. #ifndef AIO_H__
  6. #define AIO_H__
  7. enum aio_type { AIO_READ, AIO_WRITE, AIO_MMAP };
  8. struct aio_thread_reply {
  9. void *data;
  10. int err;
  11. };
  12. struct aio_context {
  13. int reply_fd;
  14. struct aio_context *next;
  15. };
  16. #define INIT_AIO_CONTEXT { .reply_fd = -1, \
  17. .next = NULL }
  18. extern int submit_aio(enum aio_type type, int fd, char *buf, int len,
  19. unsigned long long offset, int reply_fd,
  20. struct aio_context *aio);
  21. #endif