Il 12/03/2012 20:14, Michael Tokarev ha scritto:
+for (i = 0, done = 0; done bytes i iov_cnt; i++) {
+if (offset iov[i].iov_len) {
+size_t len = MIN(iov[i].iov_len - offset, bytes - done);
+memcpy(iov[i].iov_base + offset, buf + done, len);
+
On 13.03.2012 21:44, Paolo Bonzini wrote:
Il 12/03/2012 20:14, Michael Tokarev ha scritto:
+for (i = 0, done = 0; done bytes i iov_cnt; i++) {
+if (offset iov[i].iov_len) {
+size_t len = MIN(iov[i].iov_len - offset, bytes - done);
+
Reorder arguments to be more natural, readable and
consistent with other iov_* functions, and change
argument names, from:
iov_from_buf(iov, iov_cnt, buf, iov_off, size)
to
iov_from_buf(iov, iov_cnt, offset, buf, bytes)
The result becomes natural English:
copy data to this `iov' vector with