From: Marc-Aurel Zent mzent@codeweavers.com
This now accounts for system suspend periods.
See https://lkml.org/lkml/2020/5/8/1707 --- dlls/ntdll/unix/sync.c | 4 ++-- server/request.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index acdb7b3d9f8..87cd2b2f4b9 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -94,8 +94,8 @@ static inline ULONGLONG monotonic_counter(void) return mach_continuous_time() * timebase.numer / timebase.denom / 100; #elif defined(HAVE_CLOCK_GETTIME) struct timespec ts; -#ifdef CLOCK_MONOTONIC_RAW - if (!clock_gettime( CLOCK_MONOTONIC_RAW, &ts )) +#if defined(__linux__) && defined(CLOCK_BOOTTIME) + if (!clock_gettime( CLOCK_BOOTTIME, &ts )) return ts.tv_sec * (ULONGLONG)TICKSPERSEC + ts.tv_nsec / 100; #endif if (!clock_gettime( CLOCK_MONOTONIC, &ts )) diff --git a/server/request.c b/server/request.c index 835ea30cec3..9b791b68bc3 100644 --- a/server/request.c +++ b/server/request.c @@ -515,8 +515,8 @@ timeout_t monotonic_counter(void) return mach_continuous_time() * timebase.numer / timebase.denom / 100; #elif defined(HAVE_CLOCK_GETTIME) struct timespec ts; -#ifdef CLOCK_MONOTONIC_RAW - if (!clock_gettime( CLOCK_MONOTONIC_RAW, &ts )) +#if defined(__linux__) && defined(CLOCK_BOOTTIME) + if (!clock_gettime( CLOCK_BOOTTIME, &ts )) return (timeout_t)ts.tv_sec * TICKS_PER_SEC + ts.tv_nsec / 100; #endif if (!clock_gettime( CLOCK_MONOTONIC, &ts ))