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>
- int AReadF(struct aiocb *aiocbp)
- {
- int ind;
- ind=aio_read(aiocbp);
- ind=aio_error(aiocbp);
- struct aiocb **list = (struct aiocb**) calloc (1, sizeof (struct aiocb*));
- list[0] = aiocbp;
- ind = aio_suspend (list, 1, 0);
- printf ("Read buf len = %d\n", strlen((char*)aiocbp->aio_buf));
- return strlen((char*)aiocbp->aio_buf);
- }
- int AWriteF(struct aiocb *aiocbp)
- {
- int ind;
- ind=aio_write(aiocbp);
- ind=aio_error(aiocbp);
- printf("Write progress ind=%d\n",ind);
- struct aiocb **list = (struct aiocb**) calloc (1, sizeof (struct aiocb*));
- list[0] = aiocbp;
- ind = aio_suspend (list, 1, 0);
- return strlen((char*)aiocbp->aio_buf);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement