MCPcopy Index your code
hub / github.com/git/git / xwrite

Function xwrite

wrapper.c:250–266  ·  view source on GitHub ↗

* xwrite() is the same a write(), but it automatically restarts write() * operations with a recoverable error (EAGAIN and EINTR). xwrite() DOES NOT * GUARANTEE that "len" bytes is written even if the operation is successful. */

Source from the content-addressed store, hash-verified

248 * GUARANTEE that "len" bytes is written even if the operation is successful.
249 */
250ssize_t xwrite(int fd, const void *buf, size_t len)
251{
252 ssize_t nr;
253 if (len > MAX_IO_SIZE)
254 len = MAX_IO_SIZE;
255 while (1) {
256 nr = write(fd, buf, len);
257 if (nr < 0) {
258 if (errno == EINTR)
259 continue;
260 if (handle_nonblock(fd, POLLOUT, errno))
261 continue;
262 }
263
264 return nr;
265 }
266}
267
268/*
269 * xpread() is the same as pread(), but it automatically restarts pread()

Callers 12

send_client_dataFunction · 0.85
write_in_fullFunction · 0.85
fwrite_sha1_fileFunction · 0.85
child_dieFunction · 0.85
child_error_fnFunction · 0.85
child_warn_fnFunction · 0.85
child_die_fnFunction · 0.85
disconnect_helperFunction · 0.85
udt_do_writeFunction · 0.85
cmd__genzerosFunction · 0.85
report_messageFunction · 0.85
odb_stream_blob_to_fdFunction · 0.85

Calls 1

handle_nonblockFunction · 0.85

Tested by 1

cmd__genzerosFunction · 0.68