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

Function xpread

wrapper.c:273–284  ·  view source on GitHub ↗

* xpread() is the same as pread(), but it automatically restarts pread() * operations with a recoverable error (EAGAIN and EINTR). xpread() DOES * NOT GUARANTEE that "len" bytes is read even if the data is available. */

Source from the content-addressed store, hash-verified

271 * NOT GUARANTEE that "len" bytes is read even if the data is available.
272 */
273ssize_t xpread(int fd, void *buf, size_t len, off_t offset)
274{
275 ssize_t nr;
276 if (len > MAX_IO_SIZE)
277 len = MAX_IO_SIZE;
278 while (1) {
279 nr = pread(fd, buf, len, offset);
280 if ((nr < 0) && (errno == EAGAIN || errno == EINTR))
281 continue;
282 return nr;
283 }
284}
285
286ssize_t read_in_full(int fd, void *buf, size_t count)
287{

Callers 3

pread_in_fullFunction · 0.85
git_mmapFunction · 0.85
unpack_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected