Open andrewrk opened 4 years ago
I ran into this as part of #20389. riscv32 is unusual in that all the classic syscalls like ppoll
, clock_gettime
, etc operate with 64-bit time values, whereas on older 32-bit architectures, you have to call ppoll_time64
, clock_gettime64
, etc if you want 64-bit time. I think arc is also like riscv32 in this regard. In other words, on riscv32/arc, you must use a __kernel_timespec
(always 64-bit) to call ppoll
, but on e.g. x86, you use a timespec
(32-bit/64-bit depending on word size).
(I'm hacking around this for now by defining std.os.linux.timespec
as equal to kernel_timespec
on riscv32 only, which allows the time-related syscall wrappers to work. This is obviously less than ideal, but one thing at a time...)
Should our strategy for std.os.linux
just be to have the syscall wrappers take kernel_timespec
instead of timespec
and only fall back to truncating to timespec
if a 64-bit time version of the syscall is unavailable?
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.