19write_data(
const int fd,
const void *buffer_v,
const size_t length) {
20 const unsigned char* buffer(
static_cast<const unsigned char*
>(buffer_v));
21 size_t remaining = length;
24 while (remaining > 0) {
25 const int written = write(fd, buffer, remaining);
33 }
else if (written > 0) {
50read_data(
const int fd,
void *buffer_v,
const size_t length) {
51 unsigned char* buffer(
static_cast<unsigned char*
>(buffer_v));
52 size_t remaining = length;
54 while (remaining > 0) {
55 const int amount = read(fd, buffer, remaining);
62 }
else if (amount > 0) {
73 return (
static_cast<ssize_t
>(length - remaining));
Wrappers around common unix fd manipulation functions.
ssize_t read_data(const int fd, void *buffer_v, const size_t length)
bool write_data(const int fd, const void *buffer_v, const size_t length)
Defines the logger used by the top-level component of kea-lfc.