diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-02-17 22:30:53 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-02-17 22:30:53 +0000 |
commit | fdffefb8032922ce7ffe4c00816072a8ff2148fc (patch) | |
tree | bc7313151a429c45d8bab8ad8b9dd32f4e51335f /src/libstddjb/siovec_gather.c | |
parent | a896ca2a8c617e5e00ffd5fc9e69331ad754e5b3 (diff) | |
download | skalibs-fdffefb8032922ce7ffe4c00816072a8ff2148fc.tar.xz |
More types changes
New disize
Add size_t to the autotypes list
Delete redundant and replace-libc files
dev_t/ino_t pass
Big size_t pass
More things missing, still not operational yet
Diffstat (limited to 'src/libstddjb/siovec_gather.c')
-rw-r--r-- | src/libstddjb/siovec_gather.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libstddjb/siovec_gather.c b/src/libstddjb/siovec_gather.c index 23ae28a..b5fcbb7 100644 --- a/src/libstddjb/siovec_gather.c +++ b/src/libstddjb/siovec_gather.c @@ -1,17 +1,19 @@ /* ISC license. */ -#include <skalibs/bytestr.h> +#include <sys/types.h> +#include <sys/uio.h> +#include <string.h> #include <skalibs/siovec.h> -unsigned int siovec_gather (siovec_t const *v, unsigned int n, char *s, unsigned int max) +size_t siovec_gather (struct iovec const *v, unsigned int n, char *s, size_t max) { - unsigned int w = 0 ; - register unsigned int i = 0 ; + size_t w = 0 ; + unsigned int i = 0 ; for (; i < n && w < max ; i++) { - register unsigned int len = v[i].len ; + size_t len = v[i].iov_len ; if ((w + len) > max) len = max - w ; - byte_copy(s + w, len, v[i].s) ; + memmove(s + w, v[i].iov_base, len) ; w += len ; } return w ; |