diff options
Diffstat (limited to 'src/libunixonacid/buffer_timed_get.c')
-rw-r--r-- | src/libunixonacid/buffer_timed_get.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libunixonacid/buffer_timed_get.c b/src/libunixonacid/buffer_timed_get.c index af846ff..4eb1033 100644 --- a/src/libunixonacid/buffer_timed_get.c +++ b/src/libunixonacid/buffer_timed_get.c @@ -1,5 +1,6 @@ /* ISC license. */ +#include <sys/types.h> #include <skalibs/buffer.h> #include <skalibs/buffer.h> #include <skalibs/tai.h> @@ -9,8 +10,8 @@ struct blah_s { buffer *b ; char *s ; - unsigned int len ; - unsigned int w ; + size_t len ; + size_t w ; } ; static int getfd (struct blah_s *blah) @@ -18,14 +19,14 @@ static int getfd (struct blah_s *blah) return buffer_fd(blah->b) ; } -static int get (struct blah_s *blah) +static ssize_t get (struct blah_s *blah) { return buffer_getall(blah->b, blah->s, blah->len, &blah->w) ; } -unsigned int buffer_timed_get (buffer *b, char *s, unsigned int len, tain_t const *deadline, tain_t *stamp) +size_t buffer_timed_get (buffer *b, char *s, size_t len, tain_t const *deadline, tain_t *stamp) { struct blah_s blah = { .b = b, .s = s, .len = len, .w = 0 } ; - timed_get(&blah, (initfunc_t_ref)&getfd, (initfunc_t_ref)&get, deadline, stamp) ; + timed_get(&blah, (initfunc_t_ref)&getfd, (getfunc_t_ref)&get, deadline, stamp) ; return blah.w ; } |