| 324 | } |
| 325 | |
| 326 | ssize_t pread_in_full(int fd, void *buf, size_t count, off_t offset) |
| 327 | { |
| 328 | char *p = buf; |
| 329 | ssize_t total = 0; |
| 330 | |
| 331 | while (count > 0) { |
| 332 | ssize_t loaded = xpread(fd, p, count, offset); |
| 333 | if (loaded < 0) |
| 334 | return -1; |
| 335 | if (loaded == 0) |
| 336 | return total; |
| 337 | count -= loaded; |
| 338 | p += loaded; |
| 339 | total += loaded; |
| 340 | offset += loaded; |
| 341 | } |
| 342 | |
| 343 | return total; |
| 344 | } |
| 345 | |
| 346 | int xdup(int fd) |
| 347 | { |
no test coverage detected