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

#include <errno.h>
#include <skalibs/buffer.h>
#include <skalibs/siovec.h>

int buffer_getvallnofill (buffer_ref b, siovec_t const *v, unsigned int n)
{
  register unsigned int r = buffer_getvnofill(b, v, n) ;
  if (r < siovec_len(v, n))
  {
    buffer_unget(b, r) ;
    return (errno = ENOBUFS, 0) ;
  }
  return 1 ;
}