[newlib-cygwin] Cygwin: timerfd: fill out it_interval on timerfd_gettime
Corinna Vinschen
corinna@sourceware.org
Sun Jan 20 23:15:00 GMT 2019
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=02de9ac61e84c40b18f71e7d8be15f90bb01411e
commit 02de9ac61e84c40b18f71e7d8be15f90bb01411e
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Mon Jan 21 00:14:09 2019 +0100
Cygwin: timerfd: fill out it_interval on timerfd_gettime
Might not be such a bad idea, after all...
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
winsup/cygwin/timerfd.cc | 1 +
winsup/cygwin/timerfd.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/winsup/cygwin/timerfd.cc b/winsup/cygwin/timerfd.cc
index cebb002..4f04efd 100644
--- a/winsup/cygwin/timerfd.cc
+++ b/winsup/cygwin/timerfd.cc
@@ -495,6 +495,7 @@ timerfd_tracker::gettime (struct itimerspec *curr_value)
next_relative_exp -= curr_value->it_value.tv_sec * NS100PERSEC;
curr_value->it_value.tv_nsec = next_relative_exp
* (NSPERSEC / NS100PERSEC);
+ curr_value->it_interval = time_spec ().it_interval;
leave_critical_section ();
ret = 0;
}
diff --git a/winsup/cygwin/timerfd.h b/winsup/cygwin/timerfd.h
index cebd1d9..e314579 100644
--- a/winsup/cygwin/timerfd.h
+++ b/winsup/cygwin/timerfd.h
@@ -128,6 +128,7 @@ class timerfd_tracker /* cygheap! */
clock_t get_clockid () const { return tfd_shared->_clockid; }
LONG64 get_clock_now () const { return tfd_shared->get_clock_now (); }
+ struct itimerspec &time_spec () { return tfd_shared->time_spec (); }
LONG64 get_exp_ts () const { return tfd_shared->_exp_ts; }
LONG64 get_interval () const { return tfd_shared->_interval; }
int flags () const { return tfd_shared->flags (); }
More information about the Cygwin-cvs
mailing list