1 | #include "eio.h" |
1 | #include "eio.h" |
2 | #include "xthread.h" |
2 | #include "xthread.h" |
3 | |
3 | |
4 | #include <errno.h> |
4 | #include <errno.h> |
5 | |
|
|
6 | #include "EXTERN.h" |
|
|
7 | #include "perl.h" |
|
|
8 | #include "XSUB.h" |
|
|
9 | |
|
|
10 | #include <stddef.h> |
5 | #include <stddef.h> |
11 | #include <stdlib.h> |
6 | #include <stdlib.h> |
|
|
7 | #include <string.h> |
12 | #include <errno.h> |
8 | #include <errno.h> |
13 | #include <sys/types.h> |
9 | #include <sys/types.h> |
14 | #include <sys/stat.h> |
10 | #include <sys/stat.h> |
15 | #include <limits.h> |
11 | #include <limits.h> |
16 | #include <fcntl.h> |
12 | #include <fcntl.h> |
17 | #include <sched.h> |
13 | #include <sched.h> |
|
|
14 | #include <dirent.h> |
18 | |
15 | |
19 | #ifndef EIO_FINISH |
16 | #ifndef EIO_FINISH |
20 | # define EIO_FINISH(req) ((req)->finish) && !EIO_CANCELLED (req) ? (req)->finish (req) : 0 |
17 | # define EIO_FINISH(req) ((req)->finish) && !EIO_CANCELLED (req) ? (req)->finish (req) : 0 |
21 | #endif |
18 | #endif |
22 | |
19 | |
… | |
… | |
571 | |
568 | |
572 | while (todo > 0) |
569 | while (todo > 0) |
573 | { |
570 | { |
574 | size_t len = todo < EIO_BUFSIZE ? todo : EIO_BUFSIZE; |
571 | size_t len = todo < EIO_BUFSIZE ? todo : EIO_BUFSIZE; |
575 | |
572 | |
576 | pread (fd, aio_buf, len, offset); |
573 | pread (fd, eio_buf, len, offset); |
577 | offset += len; |
574 | offset += len; |
578 | todo -= len; |
575 | todo -= len; |
579 | } |
576 | } |
580 | |
577 | |
581 | errno = 0; |
578 | errno = 0; |