Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<chrono>: make
system_clock::now()
andfile_clock
aware of Windows leap second handling #1588<chrono>: make
system_clock::now()
andfile_clock
aware of Windows leap second handling #1588Changes from 9 commits
b925e16
375fe5a
319e518
22ccb75
2a9b591
1fa5f71
5c6f625
c3038de
7f2a5bd
4f3d01c
a698c6d
49bce5a
7373b98
44d4bbb
1a22caf
e4e88ec
4296d97
1336e1f
c5ee629
96d8501
0c3c998
cb7a139
5683bc0
4767cfe
d573b1e
29f5789
5b33476
e609aaa
fd4ce85
bdae556
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I'm unsure of how
_Xtime_get_ticks()
is affected by the leap-seconds-related changes in different OS versions. Specifically this function containsFILETIME ft; __crtGetSystemTimePreciseAsFileTime(&ft);
where
__crtGetSystemTimePreciseAsFileTime(&ft)
wraps eitherGetSystemTimeAsFileTime
orGetSystemTimePreciseAsFileTime
. I notice that neither of these functions is listed as an "affected API" in this blog. It would make sense to me that they would be affected in similar ways, but I just want to doublecheck / ask for some clarity here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That blog is written in a "
FILETIME
centric view". The listed "affected APIs" are those whose behavior would change in different OS versions even when the inputs/clocks represent time points with the sameFILETIME
value on each corresponding machine.GetSystemTimeAsFileTime
andGetSystemTimePreciseAsFileTime
return the currentFILETIME
, which by definition doesn't change for the sameFILETIME
, but would map to different time points in the UTC time scale.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment "
// positive leap second
" made me wonder how/whether we need to handle potential future negative leap seconds. I didn't see negative leap seconds referenced in either Dan's blogpost or Daniel's blogpost so I'm wondering if there is any documentation for how a negative leap second would be represented in the Windows API/structs/*?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not aware of any documentation explicitly mentioning the handling of negative leap seconds by Windows APIs. My experiments showed that
FileTimeToSystemTime
jumps from 23:59:58.999 to 00:00:00.000 and thatSystemTimeToFileTime
rejects 23:59:59.xxx deleted by a fake negative leap second, whether or notPROCESS_LEAP_SECOND_INFO_FLAG_ENABLE_SIXTY_SECOND
is set for the process.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code for handling negative leap seconds:
STL/stl/src/xtime0.cpp
Lines 102 to 109 in 7373b98