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

#include <sys/types.h>
#include <skalibs/allreadwrite.h>
#include <skalibs/buffer.h>
#include <skalibs/functypes.h>
#include <skalibs/tai.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) ;
}