/* ISC license. */ #include #include #include #include #include size_t allreadwritev (iovfunc_t_ref op, int fd, struct iovec const *v, unsigned int vlen) { size_t written = 0 ; struct iovec vv[vlen] ; unsigned int i = 0 ; for (; i < vlen ; i++) vv[i] = v[i] ; while (siovec_len(vv, vlen)) { register ssize_t w = (*op)(fd, vv, vlen) ; if (w <= 0) break ; w = siovec_seek(vv, vlen, w) ; written += w ; } return written ; }