summaryrefslogtreecommitdiff
path: root/src/libstddjb/buffer_getv.c
blob: 358de012a5f58bc4758eaa734b8a74e611c522ac (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/allreadwrite.h>
#include <skalibs/buffer.h>

ssize_t buffer_getv (buffer *b, struct iovec const *v, unsigned int n)
{
  size_t w = 0 ;
  ssize_t r = unsanitize_read(buffer_getvall(b, v, n, &w)) ;
  return r <= 0 ? r : w ;
}