diff options
| author | bors <bors@rust-lang.org> | 2022-05-07 17:53:59 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-05-07 17:53:59 +0000 |
| commit | 24a0eecf035235fa58c0b10bad1d3665947842e4 (patch) | |
| tree | d38c1a7a4d82a081753ac8410f611c5c754c73b9 /compiler/rustc_codegen_llvm/src | |
| parent | f9b2e3c87b76c03cc398be8b8f65d096c0583eb2 (diff) | |
| parent | f9675185a32564a8b0c455ec1da16c9a62e74b4d (diff) | |
| download | rust-24a0eecf035235fa58c0b10bad1d3665947842e4.tar.gz rust-24a0eecf035235fa58c0b10bad1d3665947842e4.zip | |
Auto merge of #96657 - cuviper:time64, r=joshtriplett
Use 64-bit time on 32-bit linux-gnu The standard library suffered the [Year 2038 problem][Y2038] in two main places on targets with 32-bit `time_t`: - In `std::time::SystemTime`, we stored a `timespec` that has `time_t` seconds. This is now changed to directly store 64-bit seconds and nanoseconds, and on 32-bit linux-gnu we try to use `__clock_gettime64` (glibc 2.34+) to get the larger timestamp. - In `std::fs::Metadata`, we store a `stat64`, which has 64-bit `off_t` but still 32-bit `time_t`, and unfortunately that is baked in the API by the (deprecated) `MetadataExt::as_raw_stat()`. However, we can use `statx` for 64-bit `statx_timestamp` to store in addition to the `stat64`, as we already do to support creation time, and the rest of the `MetadataExt` methods can return those full values. Note that some filesystems may still be limited in their actual timestamp support, but that's not something Rust can change. There remain a few places that need `timespec` for system call timeouts -- I leave that to future work. [Y2038]: https://en.wikipedia.org/wiki/Year_2038_problem
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
