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

#include <skalibs/bufalloc.h>
#include <skalibs/functypes.h>
#include <skalibs/tai.h>
#include <skalibs/unix-timed.h>

static int bufalloc_isnonempty (bufalloc *ba)
{
  return !!bufalloc_len(ba) ;
}

int bufalloc_timed_flush (bufalloc *ba, tain_t const *deadline, tain_t *stamp)
{
  return timed_flush(ba, (initfunc_t_ref)&bufalloc_getfd, (initfunc_t_ref)&bufalloc_isnonempty, (initfunc_t_ref)&bufalloc_flush, deadline, stamp) ;
}