MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / ReadFully

Function ReadFully

Bcore/src/main/cpp/android-base/file.cpp:144–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144bool 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,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected