summaryrefslogtreecommitdiff
path: root/src/libstddjb/buffer_putvflush.c
blob: 86c5b5ca97f5b82cace391010699b370855a9fe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/* ISC license. */

#include <sys/uio.h>
#include <skalibs/buffer.h>

ssize_t buffer_putvflush (buffer *b, struct iovec const *v, unsigned int n)
{
  ssize_t r = buffer_putv(b, v, n) ;
  if (r < 0) return -1 ;
  if (!buffer_flush(b)) return -1 ;
  return r ;
}