diff options
| author | Tobias Klauser <tklauser@distanz.ch> | 2023-10-03 11:20:29 +0200 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-10-03 14:13:33 +0000 |
| commit | f79c99fe8ae4a5e4380af22ee6cb38c3eb3a0416 (patch) | |
| tree | 0912b54a7eebe354b09311bc5f1e2acdb98721c4 /src/internal/syscall | |
| parent | 98289021f3444a2f80c8f7630f5e519d9c338963 (diff) | |
| download | go-f79c99fe8ae4a5e4380af22ee6cb38c3eb3a0416.tar.xz | |
internal/syscall/unix: implement Eaccess on netbsd
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>
Diffstat (limited to 'src/internal/syscall')
| -rw-r--r-- | src/internal/syscall/unix/at_sysnum_netbsd.go | 10 | ||||
| -rw-r--r-- | src/internal/syscall/unix/eaccess_bsd.go (renamed from src/internal/syscall/unix/eaccess_freebsd.go) | 2 | ||||
| -rw-r--r-- | src/internal/syscall/unix/eaccess_other.go | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/src/internal/syscall/unix/at_sysnum_netbsd.go b/src/internal/syscall/unix/at_sysnum_netbsd.go index becc1bdf82..ffb1d2eaf8 100644 --- a/src/internal/syscall/unix/at_sysnum_netbsd.go +++ b/src/internal/syscall/unix/at_sysnum_netbsd.go @@ -10,7 +10,11 @@ const unlinkatTrap uintptr = syscall.SYS_UNLINKAT 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 +) diff --git a/src/internal/syscall/unix/eaccess_freebsd.go b/src/internal/syscall/unix/eaccess_bsd.go index f2514c0a84..8f4566ef9b 100644 --- a/src/internal/syscall/unix/eaccess_freebsd.go +++ b/src/internal/syscall/unix/eaccess_bsd.go @@ -2,6 +2,8 @@ // 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 ( diff --git a/src/internal/syscall/unix/eaccess_other.go b/src/internal/syscall/unix/eaccess_other.go index 4fa2265900..f0427db302 100644 --- a/src/internal/syscall/unix/eaccess_other.go +++ b/src/internal/syscall/unix/eaccess_other.go @@ -2,7 +2,7 @@ // 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 |
