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> |
… | |
… | |
38 | # include <sys/time.h> |
34 | # include <sys/time.h> |
39 | # include <sys/select.h> |
35 | # include <sys/select.h> |
40 | # include <unistd.h> |
36 | # include <unistd.h> |
41 | # include <utime.h> |
37 | # include <utime.h> |
42 | # include <signal.h> |
38 | # include <signal.h> |
|
|
39 | # include <dirent.h> |
43 | |
40 | |
44 | # ifndef EIO_STRUCT_DIRENT |
41 | # ifndef EIO_STRUCT_DIRENT |
45 | # define EIO_STRUCT_DIRENT struct dirent |
42 | # define EIO_STRUCT_DIRENT struct dirent |
46 | # endif |
43 | # endif |
47 | |
44 | |
… | |
… | |
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; |