authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-31 03:25:48+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-31 03:31:58+02:00
log6364995d3f40efa96bec905c43182e3d4bbaea08
treee29be8fc2a6f26c11d51cd8d7b43da04740a3c2a
parent537cb49eb241521bf58df8510c1c86aea60eb84f
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

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 files changed, 1 insertions(+), 1 deletions(-)

lib/std/os/linux.zig+1-1
......@@ -7452,7 +7452,7 @@ pub const kernel_timespec = extern struct {
74527452};
74537453
74547454// https://github.com/ziglang/zig/issues/4726#issuecomment-2190337877
7455pub const timespec = if (!builtin.link_libc and native_arch == .riscv32) kernel_timespec else extern struct {
7455pub const timespec = if (native_arch == .riscv32) kernel_timespec else extern struct {
74567456 sec: isize,
74577457 nsec: isize,
74587458};