summaryrefslogtreecommitdiff
path: root/src/libunixonacid/buffer_timed_fill.c
blob: eb41b5b080654504d726aadf174244054a9d070f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* ISC license. */

#include <skalibs/allreadwrite.h>
#include <skalibs/buffer.h>
#include <skalibs/functypes.h>
#include <skalibs/unix-timed.h>

static ssize_t get (buffer *b)
{
  return sanitize_read(buffer_fill(b)) ;
}

ssize_t buffer_timed_fill (buffer *b, tain_t const *deadline, tain_t *stamp)
{
  return timed_get(b, (initfunc_t_ref)&buffer_getfd, (getfunc_t_ref)&get, deadline, stamp) ;
}