Commit 6364995d3f

Alex Rønne Petersen <alex@alexrp.com>
2024-08-31 03:25:48
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.
1 parent 537cb49
Changed files (1)
lib
std
lib/std/os/linux.zig
@@ -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,
 };