Commit cb3b1dd6dd

Koakuma <koachan@protonmail.com>
2022-03-13 10:14:47
c/linux: Fix `stat` struct definition for SPARCv9
The libc interface uses `stat` instead of `stat64` struct. This fixes, among other things, `zig fmt` accidentally setting the formatted file's permission to 000.
1 parent bb859a0
Changed files (1)
lib
std
lib/std/c/linux.zig
@@ -117,14 +117,15 @@ pub const _errno = switch (native_abi) {
 pub const Stat = switch (native_arch) {
     .sparcv9 => extern struct {
         dev: u64,
+        __pad1: u16,
         ino: ino_t,
         mode: u32,
-        nlink: usize,
+        nlink: u32,
 
         uid: u32,
         gid: u32,
         rdev: u64,
-        __pad0: u32,
+        __pad2: u16,
 
         size: off_t,
         blksize: isize,
@@ -133,7 +134,7 @@ pub const Stat = switch (native_arch) {
         atim: timespec,
         mtim: timespec,
         ctim: timespec,
-        __unused: [2]isize,
+        __reserved: [2]usize,
 
         pub fn atime(self: @This()) timespec {
             return self.atim;