Advertisement
rnort

SPO-5-LIB-FINAL

Dec 20th, 2012
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <aio.h>
  3. #include <errno.h>
  4. #include <string.h>
  5. #include <stdlib.h>
  6.  
  7. extern "C" int Read(struct aiocb *aiocbp)
  8. {
  9.     if (aio_read(aiocbp) != 0)
  10.     {
  11.         printf("aio_read() failed with error ", strerror(errno));
  12.     }
  13.     aio_suspend (&aiocbp, 1, 0);
  14.     return aio_return(aiocbp);
  15. }
  16.  
  17. extern "C" int Write(struct aiocb *aiocbp)
  18. {
  19.     if (aio_write(aiocbp) != 0)
  20.     {
  21.         printf("aio_read() failed with error ", strerror(errno));
  22.     }
  23.     aio_suspend (&aiocbp, 1, 0);
  24.     return aiocbp->aio_nbytes;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement