Like on other BSDs, use faccessat(AT_FDCWD, path, mode, AT_EACCESS)
Change-Id: I5b7649815651725ab9245aed3c8c1941ff9b7606
Reviewed-on: https://go-review.googlesource.com/c/go/+/532675
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
const openatTrap uintptr = syscall.SYS_OPENAT
const fstatatTrap uintptr = syscall.SYS_FSTATAT
-const AT_REMOVEDIR = 0x2
-const AT_SYMLINK_NOFOLLOW = 0x1
+const (
+ AT_EACCESS = 0x4
+ AT_FDCWD = 0xfffafdcd
+ AT_REMOVEDIR = 0x2
+ AT_SYMLINK_NOFOLLOW = 0x1
-const UTIME_OMIT = -0x1
+ UTIME_OMIT = -0x1
+)
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build freebsd || netbsd
+//go:build dragonfly || freebsd || netbsd
package unix
// 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 && !netbsd
+//go:build unix && !dragonfly && !freebsd && !linux && !netbsd
package unix