… | |
… | |
1094 | dBUF; |
1094 | dBUF; |
1095 | |
1095 | |
1096 | while (todo > 0) |
1096 | while (todo > 0) |
1097 | { |
1097 | { |
1098 | size_t len = todo < EIO_BUFSIZE ? todo : EIO_BUFSIZE; |
1098 | size_t len = todo < EIO_BUFSIZE ? todo : EIO_BUFSIZE; |
1099 | |
|
|
1100 | pread (fd, eio_buf, len, offset); |
|
|
1101 | offset += len; |
1099 | offset += len; |
1102 | todo -= len; |
1100 | todo -= len; |
1103 | } |
1101 | } |
1104 | |
1102 | |
1105 | FUBd; |
1103 | FUBd; |
1106 | |
1104 | |
1107 | errno = 0; |
1105 | /* linux's readahead basically only fails for EBADF or EINVAL (not mmappable) */ |
|
|
1106 | /* but not for e.g. EIO or eof, so we also never fail */ |
1108 | return count; |
1107 | return 0; |
1109 | } |
1108 | } |
1110 | |
1109 | |
1111 | #endif |
1110 | #endif |
1112 | |
1111 | |
1113 | /* sendfile always needs emulation */ |
1112 | /* sendfile always needs emulation */ |