26#ifndef MYSQL_HARNESS_NET_TS_IMPL_LINUX_EPOLL_H_
27#define MYSQL_HARNESS_NET_TS_IMPL_LINUX_EPOLL_H_
33#include <system_error>
62 int epfd = ::epoll_create1(EPOLL_CLOEXEC);
66 std::error_code{errno, std::generic_category()});
75 if (-1 == ::epoll_ctl(epfd,
static_cast<int>(cmd), fd, ev)) {
77 std::error_code{errno, std::generic_category()});
84 int epfd, epoll_event *fd_events,
size_t num_fd_events,
85 std::chrono::milliseconds
timeout) {
87 int res = ::epoll_wait(epfd, fd_events, num_fd_events,
timeout.count());
91 }
else if (res == 0) {
Definition: expected.h:944
static bool interrupted
Definition: mysqladmin.cc:66
Definition: authentication.cc:36
static bool timeout(bool(*wait_condition)())
Timeout function.
Definition: log0meb.cc:496
stdx::expected< void, std::error_code > ctl(int epfd, Cmd cmd, int fd, epoll_event *ev)
Definition: linux_epoll.h:72
Cmd
Definition: linux_epoll.h:45
stdx::expected< int, std::error_code > create()
Definition: linux_epoll.h:60
auto uninterruptable(Func &&f)
Definition: linux_epoll.h:53
stdx::expected< size_t, std::error_code > wait(int epfd, epoll_event *fd_events, size_t num_fd_events, std::chrono::milliseconds timeout)
Definition: linux_epoll.h:83
std::error_code last_error_code()
get last std::error_code for socket-errors.
Definition: socket_error.h:107
std::error_code make_error_code(net::stream_errc e) noexcept
Definition: buffer.h:103
constexpr auto make_unexpected(E &&e) -> unexpected< std::decay_t< E > >
Definition: expected.h:125