MCPcopy Create free account
hub / github.com/coreutils/coreutils / iread_fullblock

Function iread_fullblock

src/dd.c:1145–1163  ·  view source on GitHub ↗

Wrapper around iread function to accumulate full blocks. */

Source from the content-addressed store, hash-verified

1143
1144/* Wrapper around iread function to accumulate full blocks. */
1145static ssize_t
1146iread_fullblock (int fd, char *buf, idx_t size)
1147{
1148 ssize_t nread = 0;
1149
1150 while (0 < size)
1151 {
1152 ssize_t ncurr = iread (fd, buf, size);
1153 if (ncurr < 0)
1154 return ncurr;
1155 if (ncurr == 0)
1156 break;
1157 nread += ncurr;
1158 buf += ncurr;
1159 size -= ncurr;
1160 }
1161
1162 return nread;
1163}
1164
1165/* Write to FD the buffer BUF of size SIZE, processing any signals
1166 that arrive. Return the number of bytes written, setting errno if

Callers

nothing calls this directly

Calls 1

ireadFunction · 0.85

Tested by

no test coverage detected