From 68bb788df57d6725c783adb2b9018cc7db789dd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 31 Aug 2024 03:25:08 +0200 Subject: [PATCH] std.os.linux: Make nanosleep() a compile error on riscv32. This should eventually be converted to the void/{} pattern along with the other syscalls that are compile errors for riscv32. --- lib/std/os/linux.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig index 82593d6169..90298bc7cd 100644 --- a/lib/std/os/linux.zig +++ b/lib/std/os/linux.zig @@ -1465,7 +1465,9 @@ pub fn settimeofday(tv: *const timeval, tz: *const timezone) usize { } pub fn nanosleep(req: *const timespec, rem: ?*timespec) usize { - return syscall2(.nanosleep, @intFromPtr(req), @intFromPtr(rem)); + if (native_arch == .riscv32) { + @compileError("No nanosleep syscall on this architecture."); + } else return syscall2(.nanosleep, @intFromPtr(req), @intFromPtr(rem)); } pub fn pause() usize {