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

#include <sys/types.h>
#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 ;
}