53 memcpy(SEG->cache + ((
size_t)row * SEG->ncols) * SEG->len, buf,
54 SEG->len * SEG->ncols);
59 ncols = SEG->ncols - SEG->spill;
61 size = scols * SEG->len;
65 for (col = 0; col < ncols; col += scols) {
66 SEG->address(SEG, row, col, &n, &index);
67 if (SEG->seek(SEG, n, index) == -1) {
69 G_warning(_(
"File read/write operation failed: %s (%d)"),
74 if ((result = write(SEG->fd, buf, size)) != size) {
75 G_warning(
"Segment_put_row write error %s", strerror(errno));
87 buf = ((
const char *)buf) + size;
90 if ((size = SEG->spill * SEG->len)) {
91 SEG->address(SEG, row, col, &n, &index);
92 if (SEG->seek(SEG, n, index) == -1) {
94 G_warning(_(
"File read/write operation failed: %s (%d)"),
99 if (write(SEG->fd, buf, size) != size) {
100 G_warning(
"Segment_put_row final write error: %s", strerror(errno));