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

#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 ;
}