-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
update 32-bit architectures in the std lib to use 64-bit time to prepare for year 2038 #4726
Comments
I ran into this as part of #20389. riscv32 is unusual in that all the classic syscalls like (I'm hacking around this for now by defining Should our strategy for |
This is kind of a hack because the timespec in UAPI headers is actually still 32-bit while __kernel_timespec is 64-bit. But, importantly, all the syscalls take __kernel_timespec from the get-go (because riscv32 support is so recent). Defining our timespec this way will allow all the syscall wrappers in std.os.linux to do the right thing for riscv32. For other 32-bit architectures, we have to use the 64-bit time syscalls explicitly to solve the Y2038 problem. See issue ziglang#4726 for that.
This is kind of a hack because the timespec in UAPI headers is actually still 32-bit while __kernel_timespec is 64-bit. But, importantly, all the syscalls take __kernel_timespec from the get-go (because riscv32 support is so recent). Defining our timespec this way will allow all the syscall wrappers in std.os.linux to do the right thing for riscv32. For other 32-bit architectures, we have to use the 64-bit time syscalls explicitly to solve the Y2038 problem. See issue ziglang#4726 for that.
This is kind of a hack because the timespec in UAPI headers is actually still 32-bit while __kernel_timespec is 64-bit. But, importantly, all the syscalls take __kernel_timespec from the get-go (because riscv32 support is so recent). Defining our timespec this way will allow all the syscall wrappers in std.os.linux to do the right thing for riscv32. For other 32-bit architectures, we have to use the 64-bit time syscalls explicitly to solve the Y2038 problem. See issue ziglang#4726 for that.
Any updates on this? I'm getting |
This is kind of a hack because the timespec in UAPI headers is actually still 32-bit while __kernel_timespec is 64-bit. But, importantly, all the syscalls take __kernel_timespec from the get-go (because riscv32 support is so recent). Defining our timespec this way will allow all the syscall wrappers in std.os.linux to do the right thing for riscv32. For other 32-bit architectures, we have to use the 64-bit time syscalls explicitly to solve the Y2038 problem. See issue ziglang#4726 for that.
This is kind of a hack because the timespec in UAPI headers is actually still 32-bit while __kernel_timespec is 64-bit. But, importantly, all the syscalls take __kernel_timespec from the get-go (because riscv32 support is so recent). Defining our timespec this way will allow all the syscall wrappers in std.os.linux to do the right thing for riscv32. For other 32-bit architectures, we have to use the 64-bit time syscalls explicitly to solve the Y2038 problem. See issue ziglang#4726 for that.
This is kind of a hack because the timespec in UAPI headers is actually still 32-bit while __kernel_timespec is 64-bit. But, importantly, all the syscalls take __kernel_timespec from the get-go (because riscv32 support is so recent). Defining our timespec this way will allow all the syscall wrappers in std.os.linux to do the right thing for riscv32. For other 32-bit architectures, we have to use the 64-bit time syscalls explicitly to solve the Y2038 problem. See issue ziglang#4726 for that.
This is kind of a hack because the timespec in UAPI headers is actually still 32-bit while __kernel_timespec is 64-bit. But, importantly, all the syscalls take __kernel_timespec from the get-go (because riscv32 support is so recent). Defining our timespec this way will allow all the syscall wrappers in std.os.linux to do the right thing for riscv32. For other 32-bit architectures, we have to use the 64-bit time syscalls explicitly to solve the Y2038 problem. See issue ziglang#4726 for that.
The generic syscall table has different names for syscalls that take a timespec64 on 32-bit targets, in that it adds the `_time64` suffix. Similarly, the `_time32` suffix has been removed. I'm not sure if the existing logic for determining the proper timespec struct to use was subtly broken, but it should be a good chance to finish ziglang#4726 - we only have 14 years after all... In other news: - x86_64 gets `uretprobe`, a syscall to speed up returning BPF probes. - Hexagon gets `clone3`, but don't be fooled: it just returns ENOSYS.
The generic syscall table has different names for syscalls that take a timespec64 on 32-bit targets, in that it adds the `_time64` suffix. Similarly, the `_time32` suffix has been removed. I'm not sure if the existing logic for determining the proper timespec struct to use was subtly broken, but it should be a good chance to finish ziglang#4726 - we only have 14 years after all... In other news: - x86_64 gets `uretprobe`, a syscall to speed up returning BPF probes. - Hexagon gets `clone3`, but don't be fooled: it just returns ENOSYS.
The generic syscall table has different names for syscalls that take a timespec64 on 32-bit targets, in that it adds the `_time64` suffix. Similarly, the `_time32` suffix has been removed. I'm not sure if the existing logic for determining the proper timespec struct to use was subtly broken, but it should be a good chance to finish ziglang#4726 - we only have 14 years after all... In other news: - x86_64 gets `uretprobe`, a syscall to speed up returning BPF probes. - Hexagon gets `clone3`, but don't be fooled: it just returns ENOSYS.
The generic syscall table has different names for syscalls that take a timespec64 on 32-bit targets, in that it adds the `_time64` suffix. Similarly, the `_time32` suffix has been removed. I'm not sure if the existing logic for determining the proper timespec struct to use was subtly broken, but it should be a good chance to finish ziglang#4726 - we only have 14 years after all... In other news: - x86_64 gets `uretprobe`, a syscall to speed up returning BPF probes. - Hexagon gets `clone3`, but don't be fooled: it just returns ENOSYS.
The generic syscall table has different names for syscalls that take a timespec64 on 32-bit targets, in that it adds the `_time64` suffix. Similarly, the `_time32` suffix has been removed. I'm not sure if the existing logic for determining the proper timespec struct to use was subtly broken, but it should be a good chance to finish ziglang#4726 - we only have 14 years after all... In other news: - x86_64 gets `uretprobe`, a syscall to speed up returning BPF probes. - Hexagon gets `clone3`, but don't be fooled: it just returns ENOSYS.
Now that #4538 is done, it's zig std lib's turn to update. This task is to change
time_t
and related structs to be 64-bits and to call the 64-bit syscalls rather than the 32-bit ones. Here's a nice list of libc functions that have 64 bit versions:Any of these that match syscalls (or libc calls) that the zig std lib uses, should be upgraded.
The text was updated successfully, but these errors were encountered: