61 int timeout,
void *unused_context)
73 if (timeout > 0 &&
read_wait(fd, timeout) < 0)
75 if ((ret = read(fd, buf, len)) < 0 && timeout > 0 && errno == EAGAIN) {
76 msg_warn(
"read() returns EAGAIN on a readable file descriptor!");
77 msg_warn(
"pausing to avoid going into a tight select/read loop!");
80 }
else if (ret < 0 && errno == EINTR) {
ssize_t timed_read(int fd, void *buf, size_t len, int timeout, void *unused_context)
#define read_wait(fd, timeout)
void msg_warn(const char *fmt,...)