diff options
author | Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr> | 2017-03-29 11:57:53 +0200 |
---|---|---|
committer | Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr> | 2018-06-20 12:16:27 +0200 |
commit | ba0f7a55f4e714b9b6dabe02b4c6d7e85ac466e7 (patch) | |
tree | 8756a4f2f10951927a7ae970d4588be85d583bb4 /INSTALL | |
parent | 96d2ec74227e715ea30c62d6e725e36852635438 (diff) | |
download | glibc-aaribaud/y2038-rfc-3-wip.tar.gz |
Y2038: add function __difftime64aaribaud/y2038-rfc-3-wip
Note:
1. The implementation expects __time64_t arguments, and could,
in theory, require 64 bits to express the difference accurately;
but it returns a double, which only provides about 55 significant
bits.
We could make it return a long double, which would be more than
enough for 64 bits accuracy. But then, existing source code which
uses difftime, and therefore stores difftime results in doubles,
would need to change to long doubles. However, we want 64-bit time
support to work without any application source code change.
Besides, 55 bits allow for counting seconds accurately over 417
billion years, which is arguably enough for most actual uses of
difftime.
2. The 64-bit time implementation was obtained by duplicating the
original 32-bit code then simplifying the source code based on
the knowledge that __time64_t is a 64-bit signed integer for
all architectures. This led to the following removals:
- in the subtract64 function, removal of code which handled
unsigned time handling (as __time64_t is signed);
- in the difftime64 function, removal of code which handled
time bitsize smaller than or equal to that of a double matissa
(as __time64_t has more bits than a double mantissa can hold)
3. The 32-bit implementation is now a wrapper around the 64-bit
one.
Diffstat (limited to 'INSTALL')
0 files changed, 0 insertions, 0 deletions