18#include <sys/timerfd.h>
56 fFd = ::timerfd_create(clkid, TFD_NONBLOCK);
70 if (dt.
Sec() <= 0 || dt.
NSec() <= 0)
71 throw Rexception(
fCnam+
"SetRelative()",
"bad value: dt zero or negative ");
73 struct itimerspec itspec;
74 itspec.it_interval.tv_sec = 0;
75 itspec.it_interval.tv_nsec = 0;
78 if (::timerfd_settime(
fFd, 0, &itspec,
nullptr) < 0)
80 "timerfd_settime() failed: ", errno);
92 struct itimerspec itspec;
93 itspec.it_interval.tv_sec = 0;
94 itspec.it_interval.tv_nsec = 0;
95 itspec.it_value.tv_sec = 0;
96 itspec.it_value.tv_nsec = 0;
99 if (::timerfd_settime(
fFd, 0, &itspec,
nullptr) < 0)
100 throw Rexception(
fCnam+
"Cancel()",
"timerfd_settime() failed: ", errno);
104 int irc = ::read(
fFd, &cnt,
sizeof(cnt));
105 if (irc < 0 && errno != EAGAIN)
120 int irc = ::read(
fFd, &cnt,
sizeof(cnt));
122 if (errno == EAGAIN)
return 0;
bool IsOpen() const
FIXME_docs.
const struct timespec & Timespec() const
FIXME_docs.
time_t Sec() const
FIXME_docs.
long NSec() const
FIXME_docs.
uint64_t Read()
FIXME_docs.
void Open(clockid_t clkid=CLOCK_MONOTONIC)
FIXME_docs.
void SetRelative(const Rtime &dt)
FIXME_docs.
Declaration of class ReventLoop.