about summary refs log tree commit diff
path: root/src/libstddjb/bufalloc_flush.c
blob: 23a91d629a0404707683a4a763eeca889a018c9f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
/* ISC license. */

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

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