MCPcopy Create free account
hub / github.com/git/git / pread_in_full

Function pread_in_full

wrapper.c:326–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326ssize_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
346int xdup(int fd)
347{

Callers 2

open_packed_git_1Function · 0.85
verify_index_fromFunction · 0.85

Calls 1

xpreadFunction · 0.85

Tested by

no test coverage detected