node-driver: Cope with missing CLOCK_BOOTTIME

This commit is contained in:
Samuel Thibault 2023-09-24 16:16:39 +02:00 committed by Wim Taymans
parent 5aefb1f9f4
commit f9559d2e83

View file

@ -95,14 +95,18 @@ static const struct clock_info {
#ifdef CLOCK_MONOTONIC_RAW #ifdef CLOCK_MONOTONIC_RAW
{ "monotonic-raw", CLOCK_MONOTONIC_RAW }, { "monotonic-raw", CLOCK_MONOTONIC_RAW },
#endif #endif
#ifdef CLOCK_BOOTTIME
{ "boottime", CLOCK_BOOTTIME }, { "boottime", CLOCK_BOOTTIME },
#endif
}; };
static bool clock_for_timerfd(clockid_t id) static bool clock_for_timerfd(clockid_t id)
{ {
return id == CLOCK_REALTIME || return id == CLOCK_REALTIME ||
id == CLOCK_MONOTONIC || #ifdef CLOCK_BOOTTIME
id == CLOCK_BOOTTIME; id == CLOCK_BOOTTIME ||
#endif
id == CLOCK_MONOTONIC;
} }
static clockid_t clock_name_to_id(const char *name) static clockid_t clock_name_to_id(const char *name)