authorgravatar for koachan@protonmail.comKoakuma <koachan@protonmail.com> 2022-03-13 16:14:47+07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-03-13 16:48:02-04:00
logcb3b1dd6ddee65d1811fb4058b5cc0f2c06d0139
tree966044929ac44f6fc79a9373b1157cbe437ab7de
parentbb859a0be7860a544aca1543cfd724435a24e380

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 files changed, 4 insertions(+), 3 deletions(-)

lib/std/c/linux.zig+4-3
......@@ -117,14 +117,15 @@ pub const _errno = switch (native_abi) {
117117pub const Stat = switch (native_arch) {
118118 .sparcv9 => extern struct {
119119 dev: u64,
120 __pad1: u16,
120121 ino: ino_t,
121122 mode: u32,
122 nlink: usize,
123 nlink: u32,
123124
124125 uid: u32,
125126 gid: u32,
126127 rdev: u64,
127 __pad0: u32,
128 __pad2: u16,
128129
129130 size: off_t,
130131 blksize: isize,
......@@ -133,7 +134,7 @@ pub const Stat = switch (native_arch) {
133134 atim: timespec,
134135 mtim: timespec,
135136 ctim: timespec,
136 __unused: [2]isize,
137 __reserved: [2]usize,
137138
138139 pub fn atime(self: @This()) timespec {
139140 return self.atim;