summaryrefslogtreecommitdiff
path: root/src/libstddjb/buffer_getvall.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-02-17 22:30:53 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-02-17 22:30:53 +0000
commitfdffefb8032922ce7ffe4c00816072a8ff2148fc (patch)
treebc7313151a429c45d8bab8ad8b9dd32f4e51335f /src/libstddjb/buffer_getvall.c
parenta896ca2a8c617e5e00ffd5fc9e69331ad754e5b3 (diff)
downloadskalibs-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/buffer_getvall.c')
-rw-r--r--src/libstddjb/buffer_getvall.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/libstddjb/buffer_getvall.c b/src/libstddjb/buffer_getvall.c
index e34c547..ba2dfae 100644
--- a/src/libstddjb/buffer_getvall.c
+++ b/src/libstddjb/buffer_getvall.c
@@ -1,14 +1,16 @@
/* ISC license. */
+#include <sys/types.h>
+#include <sys/uio.h>
#include <errno.h>
#include <skalibs/allreadwrite.h>
#include <skalibs/buffer.h>
#include <skalibs/siovec.h>
-int buffer_getvall (buffer *b, siovec_t const *v, unsigned int n, unsigned int *written)
+int buffer_getvall (buffer *b, struct iovec const *v, unsigned int n, size_t *written)
{
- unsigned int len = siovec_len(v, n) ;
- siovec_t vv[n] ;
+ size_t len = siovec_len(v, n) ;
+ struct iovec vv[n ? n : 1] ;
if (*written > len) return (errno = EINVAL, -1) ;
{
register unsigned int i = n ;
@@ -17,8 +19,8 @@ int buffer_getvall (buffer *b, siovec_t const *v, unsigned int n, unsigned int *
siovec_seek(vv, n, *written) ;
for (;;)
{
- register int r ;
- unsigned int w = buffer_getvnofill(b, vv, n) ;
+ ssize_t r ;
+ size_t w = buffer_getvnofill(b, vv, n) ;
*written += w ;
if (*written >= len) break ;
siovec_seek(vv, n, w) ;
@@ -27,4 +29,3 @@ int buffer_getvall (buffer *b, siovec_t const *v, unsigned int n, unsigned int *
}
return 1 ;
}
-