From a37d78b92225c91cfcdf2a2fa64d9ac7e3687d74 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 5 Aug 2020 09:06:28 +0200 Subject: [PATCH] unix: check Faccessat2 returning EPERM in Faccessat Some systems (e.g. the linux-arm and linux-arm64-packet builders) return EPERM instead of ENOSYS on unimplemented syscalls. Fall back to the existing glibc-like implementation in Faccessat in this case as well. This fixes tests on the linux-arm and linux-arm64-packet builders after CL 246537. Change-Id: I7d7598f9694a2db19bd17e79f333d5de3a31c6e2 Reviewed-on: https://go-review.googlesource.com/c/sys/+/246817 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- unix/syscall_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/syscall_linux.go b/unix/syscall_linux.go index ab167368..027bcafd 100644 --- a/unix/syscall_linux.go +++ b/unix/syscall_linux.go @@ -1972,7 +1972,7 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { return faccessat(dirfd, path, mode) } - if err := Faccessat2(dirfd, path, mode, flags); err != ENOSYS { + if err := Faccessat2(dirfd, path, mode, flags); err != ENOSYS && err != EPERM { return err }