5#include "flutter/fml/platform/linux/timerfd.h"
11#include "flutter/fml/eintr_wrapper.h"
12#include "flutter/fml/logging.h"
14#if FML_TIMERFD_AVAILABLE == 0
16#include <asm/unistd.h>
17#include <sys/syscall.h>
20 return syscall(__NR_timerfd_create, clockid,
flags);
25 const struct itimerspec* utmr,
26 struct itimerspec* otmr) {
27 return syscall(__NR_timerfd_settime, ufc,
flags, utmr, otmr);
35#define NSEC_PER_SEC 1000000000
47 struct itimerspec spec = {};
48 spec.it_value.tv_sec =
static_cast<time_t
>(nano_secs /
NSEC_PER_SEC);
50 spec.it_interval = spec.it_value;
61 uint64_t fire_count = 0;
63 if (
size !=
sizeof(uint64_t)) {
66 return fire_count > 0;
static bool read(SkStream *stream, void *buffer, size_t amount)
constexpr int64_t ToNanoseconds() const
TimeDelta ToEpochDelta() const
FlutterSemanticsFlag flags
#define FML_HANDLE_EINTR(x)
#define FML_DLOG(severity)
constexpr std::size_t size(T(&array)[N])
bool TimerRearm(int fd, fml::TimePoint time_point)
Rearms the timer to expire at the given time point.
int timerfd_settime(int ufc, int flags, const struct itimerspec *utmr, struct itimerspec *otmr)
int timerfd_create(int clockid, int flags)
#define TFD_TIMER_ABSTIME