summary refs log tree commit diff
path: root/src/libstddjb/buffer_putvallnf.c
blob: cada66050e65ad3d6a6329a8f19fe3bedaaffa52 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* ISC license. */

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

int buffer_putvallnoflush (buffer *b, siovec_t const *v, unsigned int n)
{
  register unsigned int r = buffer_putvnoflush(b, v, n) ;
  if (r < siovec_len(v, n))
  {
    buffer_unput(b, r) ;
    return (errno = ENOBUFS, 0) ;
  }
  return 1 ;
}