From 144206856e26300cc814b3c894527b062db0e69f Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 29 Nov 2025 07:52:32 -0800 Subject: [PATCH] std.Io.Threaded: fix compilation for riscv32-linux --- lib/std/Io/Threaded.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig index b093bfd127..03670a9eb7 100644 --- a/lib/std/Io/Threaded.zig +++ b/lib/std/Io/Threaded.zig @@ -251,7 +251,11 @@ const Closure = struct { .sec = 0, .nsec = @as(isize, 1) << @intCast(attempt_index), }; - _ = posix.system.nanosleep(×pec, ×pec); + if (native_os == .linux) { + _ = std.os.linux.clock_nanosleep(posix.CLOCK.MONOTONIC, .{ .ABSTIME = false }, ×pec, ×pec); + } else { + _ = posix.system.nanosleep(×pec, ×pec); + } switch (@atomicRmw(CancelStatus, &closure.cancel_status, .Xchg, .requested, .monotonic).unpack()) { .requested => continue, // Retry needed in case other thread hasn't yet entered the syscall.