| 143 | } |
| 144 | |
| 145 | ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count, |
| 146 | Timeout timeout) { |
| 147 | #ifdef __APPLE__ |
| 148 | off_t len = count; |
| 149 | ssize_t ret = DOIO_ONCE(::sendfile(out_fd, in_fd, *offset, &len, nullptr, 0), |
| 150 | wait_for_fd_writable(out_fd, timeout)); |
| 151 | return (ret == 0) ? len : (int)ret; |
| 152 | #else |
| 153 | return DOIO_ONCE(::sendfile(out_fd, in_fd, offset, count), |
| 154 | wait_for_fd_writable(out_fd, timeout)); |
| 155 | #endif |
| 156 | } |
| 157 | |
| 158 | ssize_t read_n(int fd, void *buf, size_t count, Timeout timeout) { |
| 159 | return DOIO_LOOP(read(fd, buf, count, timeout), BufStep(buf, count)); |
no test coverage detected