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

Function ReadFullyAtOffset

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

Source from the content-addressed store, hash-verified

173#endif
174
175bool ReadFullyAtOffset(int fd, void* data, size_t byte_count, off64_t offset) {
176 uint8_t* p = reinterpret_cast<uint8_t*>(data);
177 while (byte_count > 0) {
178 ssize_t n = TEMP_FAILURE_RETRY(pread(fd, p, byte_count, offset));
179 if (n <= 0) return false;
180 p += n;
181 byte_count -= n;
182 offset += n;
183 }
184 return true;
185}
186
187bool WriteFully(int fd, const void* data, size_t byte_count) {
188 const uint8_t* p = reinterpret_cast<const uint8_t*>(data);

Callers 1

ReadAtOffsetMethod · 0.85

Calls 1

preadFunction · 0.85

Tested by

no test coverage detected