summaryrefslogtreecommitdiff
path: root/src/libstddjb/bufalloc_flush.c
blob: 49b2eb10fd4b1a6f0a8998de80db4b59dc13ba3a (plain)
1
2
3
4
5
6
7
8
9
10
11
/* ISC license. */

#include <skalibs/allreadwrite.h>
#include <skalibs/bufalloc.h>

int bufalloc_flush (bufalloc_ref ba)
{
  ba->p += allreadwrite((iofunc_t_ref)ba->op, ba->fd, ba->x.s + ba->p, ba->x.len - ba->p) ;
  bufalloc_clean(ba) ;
  return !ba->x.len ;
}