| 142 | } |
| 143 | |
| 144 | bool ReadFully(int fd, void* data, size_t byte_count) { |
| 145 | uint8_t* p = reinterpret_cast<uint8_t*>(data); |
| 146 | size_t remaining = byte_count; |
| 147 | while (remaining > 0) { |
| 148 | ssize_t n = TEMP_FAILURE_RETRY(read(fd, p, remaining)); |
| 149 | if (n <= 0) return false; |
| 150 | p += n; |
| 151 | remaining -= n; |
| 152 | } |
| 153 | return true; |
| 154 | } |
| 155 | |
| 156 | #if defined(_WIN32) |
| 157 | // Windows implementation of pread. Note that this DOES move the file descriptors read position, |
nothing calls this directly
no outgoing calls
no test coverage detected