Cygwin: drop support for systems not supporting QueryUnbiasedInterruptTime

i. e., Vista/2008

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2021-10-29 18:01:33 +02:00
parent e36811afb4
commit e8bfe36281
3 changed files with 6 additions and 32 deletions

View File

@ -190,26 +190,13 @@ clk_monotonic_t::now (clockid_t clockid, struct timespec *ts)
int
clk_monotonic_coarse_t::now (clockid_t clockid, struct timespec *ts)
{
if (wincap.has_unbiased_interrupt_time ())
{
/* Suspend time not taken into account, as on Linux */
ULONGLONG now;
/* Suspend time not taken into account, as on Linux */
ULONGLONG now;
QueryUnbiasedInterruptTime (&now);
ts->tv_sec = now / NS100PERSEC;
now %= NS100PERSEC;
ts->tv_nsec = now * (NSPERSEC/NS100PERSEC);
}
else
{
/* Vista-only: GetTickCount64 is biased but it's coarse and monotonic. */
ULONGLONG now;
now = GetTickCount64 (); /* Returns ms since boot */
ts->tv_sec = now / MSPERSEC;
now %= MSPERSEC;
ts->tv_nsec = now * (NSPERSEC/MSPERSEC);
}
QueryUnbiasedInterruptTime (&now);
ts->tv_sec = now / NS100PERSEC;
now %= NS100PERSEC;
ts->tv_nsec = now * (NSPERSEC/NS100PERSEC);
return 0;
}

View File

@ -34,7 +34,6 @@ wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = {
has_new_pebteb_region:false,
has_broken_whoami:true,
has_unprivileged_createsymlink:false,
has_unbiased_interrupt_time:false,
has_precise_interrupt_time:false,
has_posix_unlink_semantics:false,
has_posix_unlink_semantics_with_ignore_readonly:false,
@ -69,7 +68,6 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = {
has_new_pebteb_region:false,
has_broken_whoami:true,
has_unprivileged_createsymlink:false,
has_unbiased_interrupt_time:true,
has_precise_interrupt_time:false,
has_posix_unlink_semantics:false,
has_posix_unlink_semantics_with_ignore_readonly:false,
@ -104,7 +102,6 @@ wincaps wincap_8 __attribute__((section (".cygwin_dll_common"), shared)) = {
has_new_pebteb_region:false,
has_broken_whoami:false,
has_unprivileged_createsymlink:false,
has_unbiased_interrupt_time:true,
has_precise_interrupt_time:false,
has_posix_unlink_semantics:false,
has_posix_unlink_semantics_with_ignore_readonly:false,
@ -139,7 +136,6 @@ wincaps wincap_8_1 __attribute__((section (".cygwin_dll_common"), shared)) = {
has_new_pebteb_region:false,
has_broken_whoami:false,
has_unprivileged_createsymlink:false,
has_unbiased_interrupt_time:true,
has_precise_interrupt_time:false,
has_posix_unlink_semantics:false,
has_posix_unlink_semantics_with_ignore_readonly:false,
@ -174,7 +170,6 @@ wincaps wincap_10_1507 __attribute__((section (".cygwin_dll_common"), shared))
has_new_pebteb_region:false,
has_broken_whoami:false,
has_unprivileged_createsymlink:false,
has_unbiased_interrupt_time:true,
has_precise_interrupt_time:true,
has_posix_unlink_semantics:false,
has_posix_unlink_semantics_with_ignore_readonly:false,
@ -209,7 +204,6 @@ wincaps wincap_10_1607 __attribute__((section (".cygwin_dll_common"), shared))
has_new_pebteb_region:false,
has_broken_whoami:false,
has_unprivileged_createsymlink:false,
has_unbiased_interrupt_time:true,
has_precise_interrupt_time:true,
has_posix_unlink_semantics:false,
has_posix_unlink_semantics_with_ignore_readonly:false,
@ -244,7 +238,6 @@ wincaps wincap_10_1703 __attribute__((section (".cygwin_dll_common"), shared)) =
has_new_pebteb_region:true,
has_broken_whoami:false,
has_unprivileged_createsymlink:true,
has_unbiased_interrupt_time:true,
has_precise_interrupt_time:true,
has_posix_unlink_semantics:false,
has_posix_unlink_semantics_with_ignore_readonly:false,
@ -279,7 +272,6 @@ wincaps wincap_10_1709 __attribute__((section (".cygwin_dll_common"), shared)) =
has_new_pebteb_region:true,
has_broken_whoami:false,
has_unprivileged_createsymlink:true,
has_unbiased_interrupt_time:true,
has_precise_interrupt_time:true,
has_posix_unlink_semantics:true,
has_posix_unlink_semantics_with_ignore_readonly:false,
@ -314,7 +306,6 @@ wincaps wincap_10_1803 __attribute__((section (".cygwin_dll_common"), shared)) =
has_new_pebteb_region:true,
has_broken_whoami:false,
has_unprivileged_createsymlink:true,
has_unbiased_interrupt_time:true,
has_precise_interrupt_time:true,
has_posix_unlink_semantics:true,
has_posix_unlink_semantics_with_ignore_readonly:false,
@ -349,7 +340,6 @@ wincaps wincap_10_1809 __attribute__((section (".cygwin_dll_common"), shared)) =
has_new_pebteb_region:true,
has_broken_whoami:false,
has_unprivileged_createsymlink:true,
has_unbiased_interrupt_time:true,
has_precise_interrupt_time:true,
has_posix_unlink_semantics:true,
has_posix_unlink_semantics_with_ignore_readonly:true,
@ -384,7 +374,6 @@ wincaps wincap_10_1903 __attribute__((section (".cygwin_dll_common"), shared)) =
has_new_pebteb_region:true,
has_broken_whoami:false,
has_unprivileged_createsymlink:true,
has_unbiased_interrupt_time:true,
has_precise_interrupt_time:true,
has_posix_unlink_semantics:true,
has_posix_unlink_semantics_with_ignore_readonly:true,

View File

@ -28,7 +28,6 @@ struct wincaps
unsigned has_new_pebteb_region : 1;
unsigned has_broken_whoami : 1;
unsigned has_unprivileged_createsymlink : 1;
unsigned has_unbiased_interrupt_time : 1;
unsigned has_precise_interrupt_time : 1;
unsigned has_posix_unlink_semantics : 1;
unsigned has_posix_unlink_semantics_with_ignore_readonly : 1;
@ -95,7 +94,6 @@ public:
bool IMPLEMENT (has_new_pebteb_region)
bool IMPLEMENT (has_broken_whoami)
bool IMPLEMENT (has_unprivileged_createsymlink)
bool IMPLEMENT (has_unbiased_interrupt_time)
bool IMPLEMENT (has_precise_interrupt_time)
bool IMPLEMENT (has_posix_unlink_semantics)
bool IMPLEMENT (has_posix_unlink_semantics_with_ignore_readonly)