blob: bf01012e4f7c4f5dc2b8352ad1969283a1d01013 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
/* ISC license. */
#include <sys/types.h>
#include <errno.h>
#include <skalibs/buffer.h>
ssize_t buffer_get (buffer *b, char *s, size_t len)
{
size_t w = 0 ;
int r = buffer_getall(b, s, len, &w) ;
return r == -1 ? errno == EPIPE ? (errno = 0, w) : -1 :
!r ? (errno = EWOULDBLOCK, -1) : w ;
}
|