23 RCSID(
"$Id: ce65a28ed43999cd68ecf632d2fdf5846c5be42e $")
25 #include <freeradius-devel/util/iovec.h>
26 #include <freeradius-devel/util/strerror.h>
27 #include <freeradius-devel/util/syserror.h>
45 (
uint8_t *)vector[i].iov_base, vector[i].iov_len);
70 struct iovec *vector_p = vector;
76 wrote = writev(fd, vector_p, iovcnt);
83 if (total + wrote < total)
return -1;
90 if (wrote >= (
ssize_t)vector_p->iov_len) {
92 wrote -= vector_p->iov_len;
100 vector_p->iov_len -= wrote;
101 vector_p->iov_base = ((
char *)vector_p->iov_base) + wrote;
105 }
else if (wrote == 0)
return total;
109 #if EWOULDBLOCK != EAGAIN
120 FD_SET(fd, &write_set);
125 }
while ((ret == -1) && (errno == EINTR));
#define FR_DBUFF_IN_MEMCPY_RETURN(_dbuff_or_marker, _in, _inlen)
Copy exactly _inlen bytes into dbuff or marker returning if there's insufficient space.
#define FR_DBUFF(_dbuff_or_marker)
Create a new dbuff pointing to the same underlying buffer.
#define fr_cond_assert(_x)
Calls panic_action ifndef NDEBUG, else logs error and evaluates to value of _x.
static fr_time_delta_t timeout
ssize_t fr_writev(int fd, struct iovec vector[], int iovcnt, fr_time_delta_t timeout)
Write out a vector to a file descriptor.
fr_slen_t fr_concatv(fr_dbuff_t *out, struct iovec vector[], int iovcnt)
Concatenate an iovec into a dbuff.
char const * fr_syserror(int num)
Guaranteed to be thread-safe version of strerror.
#define fr_time_delta_to_timeval(_delta)
Convert a delta to a timeval.
A time delta, a difference in time measured in nanoseconds.
#define fr_strerror_printf(_fmt,...)
Log to thread local error buffer.
#define fr_strerror_const(_msg)
return fr_dbuff_set(dbuff, &our_dbuff)
static size_t char ** out