arm/mips32/ppc32/x86 have similar wrappers for those two syscalls. arm/mips32 ones do not handled 4th arguments (int flags) of syscall. Not tested. Reproducible: Always
Created attachment 101680 [details] patch
Created attachment 101681 [details] move all *stat*64 to generic this patch adds stat64 and lstat64
should check first with build. stat structure differ per arch ;(
Created attachment 101683 [details] Handle (int flags) argument of fstatat64 on arm and ppc32 x86 and mips32 have wrappers which support all 4 arguments. So let arm and ppc32 join them.
Marcin, please double check with the actual arm and ppc32 kernel and glibc that these syscalls really take the 4th argument (flags). Perhaps they use oabi-compat?
I forgot how I wanted to rewrite it.