]> Cypherpunks repositories - gostls13.git/commitdiff
internal/syscall/unix: implement Eaccess on netbsd
authorTobias Klauser <tklauser@distanz.ch>
Tue, 3 Oct 2023 09:20:29 +0000 (11:20 +0200)
committerGopher Robot <gobot@golang.org>
Tue, 3 Oct 2023 14:13:33 +0000 (14:13 +0000)
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>

src/internal/syscall/unix/at_sysnum_netbsd.go
src/internal/syscall/unix/eaccess_bsd.go [moved from src/internal/syscall/unix/eaccess_freebsd.go with 95% similarity]
src/internal/syscall/unix/eaccess_other.go

index becc1bdf8233e769907c6c5009a9e891bcdfcd15..ffb1d2eaf8b1f47d080431e41520f75f6521f445 100644 (file)
@@ -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
+)
similarity index 95%
rename from src/internal/syscall/unix/eaccess_freebsd.go
rename to src/internal/syscall/unix/eaccess_bsd.go
index f2514c0a8476105edbe56dffe0e61c4d88d8de61..8f4566ef9bc128bb044a97cd9796614bfd26c398 100644 (file)
@@ -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 (
index 4fa2265900f9db9221f31d2f4ed8cd8d741df2fe..f0427db302bda9cf49595c364b5e32ca7c424f5d 100644 (file)
@@ -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