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

#include <sys/uio.h>
#include <skalibs/siovec.h>
#include <skalibs/cbuffer.h>

size_t cbuffer_put (cbuffer *b, char const *s, size_t len)
{
  struct iovec v[2] ;
  size_t w ;
  cbuffer_wpeek(b, v) ;
  w = siovec_scatter(v, 2, s, len) ;
  return cbuffer_WSEEK(b, w) ;
}