std.os.linux: Also use kernel_timespec for riscv32 when libc is linked.

Both glibc and musl use time64 as the base ABI for riscv32. This fixes the
`sleep` test in `std.time` hanging forever due to the libc functions reading
bogus values.
This commit is contained in:
Alex Rønne Petersen 2024-08-31 03:25:48 +02:00
parent 537cb49eb2
commit 6364995d3f
No known key found for this signature in database

View File

@ -7452,7 +7452,7 @@ pub const kernel_timespec = extern struct {
};
// https://github.com/ziglang/zig/issues/4726#issuecomment-2190337877
pub const timespec = if (!builtin.link_libc and native_arch == .riscv32) kernel_timespec else extern struct {
pub const timespec = if (native_arch == .riscv32) kernel_timespec else extern struct {
sec: isize,
nsec: isize,
};