Lines Matching refs:cnt

219 	off_t cnt;
248 if ((cnt = (skcnt/blksz) * blksz) < skcnt)
249 cnt += blksz;
250 if (ar_rev((off_t)cnt) < 0)
258 if ((cnt -= skcnt) > 0) {
274 bufpt = buf + cnt;
385 pback(char *pt, int cnt)
387 bufpt -= cnt;
388 memcpy(bufpt, pt, cnt);
404 off_t cnt;
427 * based on rdblksz. we skip over "cnt" complete records
430 cnt = (skcnt/rdblksz) * rdblksz;
436 if (ar_fow(cnt, &skipped) < 0)
438 res += cnt - skipped;
446 cnt = bufend - bufpt;
450 if ((cnt <= 0) && ((cnt = buf_fill()) < 0))
452 if (cnt == 0)
454 cnt = MIN(cnt, res);
455 bufpt += cnt;
456 res -= cnt;
493 int cnt;
500 cnt = bufend - bufpt;
501 if ((cnt <= 0) && ((cnt = buf_flush(blksz)) < 0))
506 cnt = MIN(cnt, outcnt);
507 memcpy(bufpt, out, cnt);
508 bufpt += cnt;
509 out += cnt;
510 outcnt -= cnt;
530 int cnt;
537 cnt = bufend - bufpt;
538 if ((cnt <= 0) && ((cnt = buf_fill()) <= 0)) {
547 return cnt;
554 cnt = MIN(cnt, incnt);
555 memcpy(in, bufpt, cnt);
556 bufpt += cnt;
557 incnt -= cnt;
558 in += cnt;
577 int cnt;
583 cnt = bufend - bufpt;
584 if ((cnt <= 0) && ((cnt = buf_flush(blksz)) < 0))
586 cnt = MIN(cnt, skcnt);
587 memset(bufpt, 0, cnt);
588 bufpt += cnt;
589 skcnt -= cnt;
615 int cnt;
633 cnt = bufend - bufpt;
634 if ((cnt <= 0) && ((cnt = buf_flush(blksz)) < 0)) {
638 cnt = MIN(cnt, size);
639 if ((res = read_with_restart(ifd, bufpt, cnt)) <= 0)
685 int cnt = 0;
716 cnt = bufend - bufpt;
722 if ((cnt <= 0) && ((cnt = buf_fill()) <= 0))
724 cnt = MIN(cnt, size);
725 if ((res = file_write(ofd,bufpt,cnt,&rem,&isem,sz,fnm)) <= 0) {
734 cnt = res;
735 while (--cnt >= 0)
784 int cnt;
829 if ((cnt = read_with_restart(fd1, buf, blksz)) <= 0)
832 res = xwrite(fd2, buf, cnt);
834 res = file_write(fd2, buf, cnt, &rem, &isem, sz, fnm);
835 if (res != cnt)
837 cpcnt += cnt;
885 int cnt;
896 if ((cnt = ar_read(buf, blksz)) > 0) {
898 bufend = buf + cnt;
899 rdcnt += cnt;
900 return cnt;
909 if (cnt < 0)
933 int cnt;
976 cnt = ar_write(buf, blksz);
977 if (cnt == blksz) {
981 wrcnt += cnt;
982 totcnt += cnt;
997 } else if (cnt > 0) {
1004 totcnt += cnt;
1005 wrcnt += cnt;
1006 bufpt = buf + cnt;
1007 cnt = bufcnt - cnt;
1008 memcpy(buf, bufpt, cnt);
1009 bufpt = buf + cnt;
1010 if (!frmt->blkalgn || ((cnt % frmt->blkalgn) == 0))