Like on linux and freebsd, use faccessat(AT_FDCWD, path, mode, AT_EACCESS)
Change-Id: Ia76ba67023b6deba6f0cdaf30a0b9cee0c140bb8
Reviewed-on: https://go-review.googlesource.com/c/go/+/531876
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
const openatTrap uintptr = syscall.SYS_OPENAT
const fstatatTrap uintptr = syscall.SYS_FSTATAT
-const AT_REMOVEDIR = 0x800
-const AT_SYMLINK_NOFOLLOW = 0x200
+const (
+ AT_EACCESS = 0x100
+ AT_FDCWD = -0x64
+ AT_REMOVEDIR = 0x800
+ AT_SYMLINK_NOFOLLOW = 0x200
-const UTIME_OMIT = (1 << 30) - 2
+ UTIME_OMIT = (1 << 30) - 2
+)
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build freebsd || netbsd
+
package unix
import (
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build unix && !freebsd && !linux
+//go:build unix && !freebsd && !linux && !netbsd
package unix