diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-02-15 17:40:40 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-02-15 17:40:40 +0000 |
commit | a896ca2a8c617e5e00ffd5fc9e69331ad754e5b3 (patch) | |
tree | f49a8382b9999b5aa00c0885eedd5c5c3a233e55 /src/libstddjb/allreadwritev.c | |
parent | 00c9cb1b22cc17c4db573e0e613a5f116ff0092e (diff) | |
download | skalibs-a896ca2a8c617e5e00ffd5fc9e69331ad754e5b3.tar.xz |
add arc4random_addrandom sysdep; next batch of types changes.
The library isn't supposed to be functional yet: there are
still a lot of type mismatches.
Diffstat (limited to 'src/libstddjb/allreadwritev.c')
-rw-r--r-- | src/libstddjb/allreadwritev.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/libstddjb/allreadwritev.c b/src/libstddjb/allreadwritev.c index 28695a1..2b06ac7 100644 --- a/src/libstddjb/allreadwritev.c +++ b/src/libstddjb/allreadwritev.c @@ -1,18 +1,20 @@ /* ISC license. */ -#include <errno.h> +#include <sys/types.h> +#include <sys/uio.h> +#include <skalibs/functypes.h> #include <skalibs/allreadwrite.h> #include <skalibs/siovec.h> -unsigned int allreadwritev (iovfunc_t_ref op, int fd, siovec_t const *v, unsigned int vlen) +size_t allreadwritev (iovfunc_t_ref op, int fd, struct iovec const *v, unsigned int vlen) { - register unsigned int written = 0 ; - siovec_t vv[vlen] ; - for (; written < vlen ; written++) vv[written] = v[written] ; - written = 0 ; + 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 int w = (*op)(fd, vv, vlen) ; + register ssize_t w = (*op)(fd, vv, vlen) ; if (w <= 0) break ; w = siovec_seek(vv, vlen, w) ; written += w ; |