--- a/coregrind/m_aspacemgr/aspacemgr-common.c +++ b/coregrind/m_aspacemgr/aspacemgr-common.c @@ -262,7 +262,7 @@ SysRes ML_(am_open) ( const HChar* pathname, Int flags, Int mode ) { -# if defined(VGP_arm64_linux) || defined(VGP_nanomips_linux) +# if defined(VGP_arm64_linux) || defined(VGP_nanomips_linux) || defined(__ANDROID__) /* ARM64 wants to use __NR_openat rather than __NR_open. */ SysRes res = VG_(do_syscall4)(__NR_openat, VKI_AT_FDCWD, (UWord)pathname, flags, mode); @@ -291,7 +291,7 @@ Int ML_(am_readlink)(const HChar* path, HChar* buf, UInt bufsiz) { SysRes res; -# if defined(VGP_arm64_linux) || defined(VGP_nanomips_linux) +# if defined(VGP_arm64_linux) || defined(VGP_nanomips_linux) || defined(__ANDROID__) res = VG_(do_syscall4)(__NR_readlinkat, VKI_AT_FDCWD, (UWord)path, (UWord)buf, bufsiz); # elif defined(VGO_linux) || defined(VGO_darwin) || defined(VGO_freebsd) @@ -330,6 +330,7 @@ # if defined(VGO_linux) || defined(VGO_darwin) SysRes res; # if defined(VGO_linux) +#ifndef __ANDROID__ /* First try with statx. */ struct vki_statx bufx; const char* file_name = ""; @@ -341,6 +342,7 @@ *mode = (UInt)bufx.stx_mode; return True; } +#endif # endif // VGO_linux only # if defined(VGO_linux) && defined(__NR_fstat64) --- a/coregrind/m_libcfile.c +++ b/coregrind/m_libcfile.c @@ -290,7 +290,7 @@ SysRes VG_(open) ( const HChar* pathname, Int flags, Int mode ) { -# if defined(VGP_arm64_linux) || defined(VGP_nanomips_linux) +# if defined(VGP_arm64_linux) || defined(VGP_nanomips_linux) || defined(__ANDROID__) /* ARM64 wants to use __NR_openat rather than __NR_open. */ SysRes res = VG_(do_syscall4)(__NR_openat, VKI_AT_FDCWD, (UWord)pathname, flags, mode); @@ -511,7 +511,7 @@ SysRes res; VG_(memset)(vgbuf, 0, sizeof(*vgbuf)); -# if defined(VGO_linux) +# if defined(VGO_linux) && !defined(__ANDROID__) /* On Linux, first try with statx. If that doesn't work out, fall back to the stat64 or vanilla version. */ { struct vki_statx buf; @@ -546,6 +546,12 @@ # if defined(VGP_arm64_linux) res = VG_(do_syscall3)(__NR3264_fstatat, VKI_AT_FDCWD, (UWord)file_name, (UWord)&buf); +# elif defined(__NR_newfstatat) + res = VG_(do_syscall3)(__NR_newfstatat, VKI_AT_FDCWD, + (UWord)file_name, (UWord)&buf); +# elif defined(__NR_fstatat64) + res = VG_(do_syscall3)(__NR_fstatat64, VKI_AT_FDCWD, + (UWord)file_name, (UWord)&buf); # else res = VG_(do_syscall2)(__NR_stat, (UWord)file_name, (UWord)&buf); # endif @@ -595,7 +601,7 @@ SysRes res; VG_(memset)(vgbuf, 0, sizeof(*vgbuf)); -# if defined(VGO_linux) +# if defined(VGO_linux) && !defined(__ANDROID__) /* On Linux, first try with statx. If that doesn't work out, fall back to the fstat64 or vanilla version. */ { struct vki_statx buf; @@ -994,9 +1000,9 @@ UWord w = (irusr ? VKI_R_OK : 0) | (iwusr ? VKI_W_OK : 0) | (ixusr ? VKI_X_OK : 0); -# if defined(VGP_arm64_linux) || defined(VGP_nanomips_linux) +# if defined(VGP_arm64_linux) || defined(VGP_nanomips_linux) || defined(__ANDROID__) SysRes res = VG_(do_syscall3)(__NR_faccessat, VKI_AT_FDCWD, (UWord)path, w); -# elif defined(VGO_linux) || defined(VGO_darwin) || defined(VGO_freebsd) +# elif defined(VGO_linux) && !defined(__ANDROID__) || defined(VGO_darwin) || defined(VGO_freebsd) SysRes res = VG_(do_syscall2)(__NR_access, (UWord)path, w); # elif defined(VGO_solaris) SysRes res = VG_(do_syscall4)(__NR_faccessat, VKI_AT_FDCWD, (UWord)path,