Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <aio.h>
- #include <errno.h>
- #include <string.h>
- #include <stdlib.h>
- extern "C" int Read(struct aiocb *aiocbp)
- {
- if (aio_read(aiocbp) != 0)
- {
- printf("aio_read() failed with error ", strerror(errno));
- }
- aio_suspend (&aiocbp, 1, 0);
- return aio_return(aiocbp);
- }
- extern "C" int Write(struct aiocb *aiocbp)
- {
- if (aio_write(aiocbp) != 0)
- {
- printf("aio_read() failed with error ", strerror(errno));
- }
- aio_suspend (&aiocbp, 1, 0);
- return aiocbp->aio_nbytes;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement