zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 6364995d3f40efa96bec905c43182e3d4bbaea08 (tree)
parent 537cb49eb241521bf58df8510c1c86aea60eb84f
Author: Alex Rønne Petersen <alex@alexrp.com>
Date:   Sat, 31 Aug 2024 03:25:48 +0200

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.

Diffstat:
Mlib/std/os/linux.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/std/os/linux.zig b/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, };