Lines Matching refs:bufs
101 req->bufs = NULL; \
400 const struct iovec* bufs, in uv__preadv_or_pwritev_emul() argument
412 p = bufs[i].iov_base; in uv__preadv_or_pwritev_emul()
413 n = bufs[i].iov_len; in uv__preadv_or_pwritev_emul()
447 const struct iovec* bufs, in uv__preadv_emul() argument
450 return uv__preadv_or_pwritev_emul(fd, bufs, nbufs, off, /*is_pread*/1); in uv__preadv_emul()
455 const struct iovec* bufs, in uv__pwritev_emul() argument
458 return uv__preadv_or_pwritev_emul(fd, bufs, nbufs, off, /*is_pread*/0); in uv__pwritev_emul()
471 const struct iovec* bufs, in uv__preadv_or_pwritev() argument
494 return f(fd, bufs, nbufs, off); in uv__preadv_or_pwritev()
499 const struct iovec* bufs, in uv__preadv() argument
503 return uv__preadv_or_pwritev(fd, bufs, nbufs, off, &cache, /*is_pread*/1); in uv__preadv()
508 const struct iovec* bufs, in uv__pwritev() argument
512 return uv__preadv_or_pwritev(fd, bufs, nbufs, off, &cache, /*is_pread*/0); in uv__pwritev()
517 const struct iovec* bufs; in uv__fs_read() local
526 bufs = (const struct iovec*) req->bufs; in uv__fs_read()
536 r = read(fd, bufs->iov_base, bufs->iov_len); in uv__fs_read()
538 r = readv(fd, bufs, nbufs); in uv__fs_read()
541 r = pread(fd, bufs->iov_base, bufs->iov_len, off); in uv__fs_read()
543 r = uv__preadv(fd, bufs, nbufs, off); in uv__fs_read()
560 if (req->bufs != req->bufsml) in uv__fs_read()
561 uv__free(req->bufs); in uv__fs_read()
563 req->bufs = NULL; in uv__fs_read()
1213 const struct iovec* bufs; in uv__fs_write() local
1221 bufs = (const struct iovec*) req->bufs; in uv__fs_write()
1227 r = write(fd, bufs->iov_base, bufs->iov_len); in uv__fs_write()
1229 r = writev(fd, bufs, nbufs); in uv__fs_write()
1232 r = pwrite(fd, bufs->iov_base, bufs->iov_len, off); in uv__fs_write()
1234 r = uv__pwritev(fd, bufs, nbufs, off); in uv__fs_write()
1635 static size_t uv__fs_buf_offset(uv_buf_t* bufs, size_t size) { in uv__fs_buf_offset() argument
1638 for (offset = 0; size > 0 && bufs[offset].len <= size; ++offset) in uv__fs_buf_offset()
1639 size -= bufs[offset].len; in uv__fs_buf_offset()
1643 bufs[offset].base += size; in uv__fs_buf_offset()
1644 bufs[offset].len -= size; in uv__fs_buf_offset()
1652 uv_buf_t* bufs; in uv__fs_write_all() local
1658 bufs = req->bufs; in uv__fs_write_all()
1679 req->nbufs = uv__fs_buf_offset(req->bufs, result); in uv__fs_write_all()
1680 req->bufs += req->nbufs; in uv__fs_write_all()
1685 if (bufs != req->bufsml) in uv__fs_write_all()
1686 uv__free(bufs); in uv__fs_write_all()
1688 req->bufs = NULL; in uv__fs_write_all()
2034 const uv_buf_t bufs[], in uv_fs_read() argument
2040 if (bufs == NULL || nbufs == 0) in uv_fs_read()
2045 req->bufs = (uv_buf_t*) bufs; /* Safe, doesn't mutate |bufs| */ in uv_fs_read()
2051 req->bufs = req->bufsml; in uv_fs_read()
2053 req->bufs = uv__malloc(nbufs * sizeof(*bufs)); in uv_fs_read()
2055 if (req->bufs == NULL) in uv_fs_read()
2058 memcpy(req->bufs, bufs, nbufs * sizeof(*bufs)); in uv_fs_read()
2224 const uv_buf_t bufs[], in uv_fs_write() argument
2230 if (bufs == NULL || nbufs == 0) in uv_fs_write()
2236 req->bufs = req->bufsml; in uv_fs_write()
2238 req->bufs = uv__malloc(nbufs * sizeof(*bufs)); in uv_fs_write()
2240 if (req->bufs == NULL) in uv_fs_write()
2243 memcpy(req->bufs, bufs, nbufs * sizeof(*bufs)); in uv_fs_write()
2278 if (req->bufs != req->bufsml) in uv_fs_req_cleanup()
2279 uv__free(req->bufs); in uv_fs_req_cleanup()
2280 req->bufs = NULL; in uv_fs_req_cleanup()