Commit e374ae3598

LemonBoy <thatlemon@gmail.com>
2020-11-08 16:34:44
std: Use newfstatat on PPC64
One more variation in the syscall table, hooray!
1 parent 4e2a4e1
Changed files (1)
lib
std
lib/std/os/linux.zig
@@ -1098,6 +1098,8 @@ pub fn lstat(pathname: [*:0]const u8, statbuf: *kernel_stat) usize {
 pub fn fstatat(dirfd: i32, path: [*:0]const u8, stat_buf: *kernel_stat, flags: u32) usize {
     if (@hasField(SYS, "fstatat64")) {
         return syscall4(.fstatat64, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags);
+    } else if (@hasField(SYS, "newfstatat")) {
+        return syscall4(.newfstatat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags);
     } else {
         return syscall4(.fstatat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags);
     }