diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig index cf5846caad0d..b23e0311ad6e 100644 --- a/lib/std/os/linux.zig +++ b/lib/std/os/linux.zig @@ -6267,12 +6267,13 @@ pub const POSIX_FADV = switch (native_arch) { }; /// The timespec struct used by the kernel. -pub const kernel_timespec = if (@sizeOf(usize) >= 8) timespec else extern struct { +pub const kernel_timespec = extern struct { sec: i64, nsec: i64, }; -pub const timespec = extern struct { +// TODO: This is a temporary hack until we figure out a coherent Y2038 strategy. +pub const timespec = if (!builtin.link_libc and native_arch == .riscv32) kernel_timespec else extern struct { sec: isize, nsec: isize, };