Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
y2038: Support for Y2038 safe time on 32 bit systems
The time_t type is now Y2038 safe, which means that it is aliased to __time64_t when __USE_TIME_BITS64 is defined or __time_t otherwise. On the contrary the __time_t for 32 bit systems is only 32 bit, so for Y2038 safe system it must be 64 bit (as is time_t) This patch introduces the Y2038 specific code to make clock_settime/ __clock_settime64 Y2038 safe on 32 bit systems. This goal is achieved by using aliasing to clock_settime names when __USE_TIME_BITS64 is defined. As a result user programs call 64 bit versions of functions (i.e. __clock_settime64 instead of __clock_settime), which must have been globally visible for this purpose - for non Y2038 safe code those are hidden in glibc. Additionally this patch also converts following syscalls to be Y2038: - clock_gettime64 - clock_settime64 - clock_getres64 - utimensat - futimens - clock_nanosleep_time64 - ppoll64 - timer_gettime - timer_settime - timerfd_gettime (WIP) - timerfd_settime (WIP) - sched_rr_get_interval (WIP) - timespec_get (WIP) - settimeofday (WIP) --- Changes for vX: - Adjust the code to the current master branch of glibc - Add support for converting clock_getres to be Y2038 safe - Extend struct timeval to be Y2038 safe Changes for v3: - Only support clock_settime conversion to be Y2038 (use it as an example conversion code) Changes for v2: - Introduce unnamed padding in the struct timespec exported by glibc (to the /usr/include)
- Loading branch information
Lukasz Majewski
committed
Jan 18, 2020
1 parent
2328b06
commit e03c718
Showing
13 changed files
with
190 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,5 +137,6 @@ libc { | |
__fcntl_nocancel; | ||
__open64_nocancel; | ||
__write_nocancel; | ||
__ppoll64; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters