Browse Source

for mips64 with N32 ABI we need to use newfstatat

Fixes compile errors with latest util-linux.
Waldemar Brodkorb 9 years ago
parent
commit
5f7dc9b625
1 changed files with 8 additions and 0 deletions
  1. 8 0
      libc/sysdeps/linux/common/fstatat64.c

+ 8 - 0
libc/sysdeps/linux/common/fstatat64.c

@@ -10,10 +10,18 @@
 #include <bits/wordsize.h>
 #include <sys/syscall.h>
 
+#if defined __mips__
+# include <sgidefs.h>
+#endif
+
 /* 64bit ports tend to favor newfstatat() */
 #if __WORDSIZE == 64 && defined __NR_newfstatat
 # define __NR_fstatat64 __NR_newfstatat
 #endif
+/* mips N32 ABI use newfstatat(), too */
+#if defined __mips__ && _MIPS_SIM == _ABIN32
+# define __NR_fstatat64 __NR_newfstatat
+#endif
 
 #ifdef __NR_fstatat64
 # include <sys/stat.h>