The whole range with pread (a short read continues); false on an error or an end of file.
| 1129 | bool resident_sampled_n(const uint8_t* p, uint64_t n) { return resident_sampled(p, n) >= n; } |
| 1130 | /// The whole range with pread (a short read continues); false on an error or an end of file. |
| 1131 | bool pread_full(int fd, uint8_t* dst, uint64_t n, uint64_t off) { |
| 1132 | uint64_t done = 0; |
| 1133 | while (done < n) { |
| 1134 | const ssize_t r = ::pread(fd, dst + done, (size_t) (n - done), (off_t) (off + done)); |
| 1135 | if (r < 0) { if (errno == EINTR) continue; return false; } |
| 1136 | if (r == 0) return false; |
| 1137 | done += (uint64_t) r; |
| 1138 | } |
| 1139 | return true; |
| 1140 | } |
| 1141 | } // namespace |
| 1142 | #endif |
| 1143 |
no outgoing calls
no test coverage detected