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

#include <sys/types.h>
#include <errno.h>
#include <skalibs/iobuffer.h>

ssize_t iobuffer_fill (iobuffer_ref b)
{
  if (b->isk)
  {
    ssize_t r = iobufferk_fill(&b->x.k) ;
    if (r >= 0 || errno != ENOSYS || !iobuffer_salvage(b)) return r ;
  }
  return iobufferu_fill(&b->x.u) ;
}