diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2025-07-16 11:46:02 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2025-07-16 12:16:29 +0200 |
commit | 2e8c180a837e83e2a37ee68e6b38b40462d5c5d2 (patch) | |
tree | d98d24b28df16261affba37577c22906179ac839 | |
parent | 167ace9a6d9605f67cd52369dd1e7758ec0d0af5 (diff) | |
download | newlib-2e8c180a837e83e2a37ee68e6b38b40462d5c5d2.zip newlib-2e8c180a837e83e2a37ee68e6b38b40462d5c5d2.tar.gz newlib-2e8c180a837e83e2a37ee68e6b38b40462d5c5d2.tar.bz2 |
Cygwin: POSIX timer: handle TIMER_ABSTIME correctly for all realtime clocks
Add CLOCK_REALTIME_COARSE and CLOCK_REALTIME_ALARM to the clocks
allowing an absolute timeout value to be used as such in NtSetTimer.
Fixes: c05df02725c59 ("Cygwin: implement extensible clock interface")
Fixes: 013e2bd9ecf85 ("Cygwin: posix timers: Add support for CLOCK_REALTIME_ALARM/CLOCK_BOOTTIME_ALARM")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r-- | winsup/cygwin/posix_timer.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/winsup/cygwin/posix_timer.cc b/winsup/cygwin/posix_timer.cc index a336b2b..14694a8 100644 --- a/winsup/cygwin/posix_timer.cc +++ b/winsup/cygwin/posix_timer.cc @@ -349,7 +349,9 @@ timer_tracker::settime (int flags, const itimerspec *new_value, / (NSPERSEC / NS100PERSEC); if (flags & TIMER_ABSTIME) { - if (clock_id == CLOCK_REALTIME) + if (clock_id == CLOCK_REALTIME_COARSE + || clock_id == CLOCK_REALTIME + || clock_id == CLOCK_REALTIME_ALARM) DueTime.QuadPart = ts + FACTOR; else /* non-REALTIME clocks require relative DueTime. */ { |