]> Cypherpunks repositories - gostls13.git/commitdiff
internal/syscall/unix: implement Eaccess on dragonfly
authorTobias Klauser <tklauser@distanz.ch>
Wed, 4 Oct 2023 16:07:37 +0000 (18:07 +0200)
committerGopher Robot <gobot@golang.org>
Fri, 6 Oct 2023 20:48:47 +0000 (20:48 +0000)
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>
src/internal/syscall/unix/at_sysnum_dragonfly.go
src/internal/syscall/unix/eaccess_bsd.go
src/internal/syscall/unix/eaccess_other.go

index b7ed3f732b8b88db2542ee88c7bcad990e3ffa87..9ac1f919f147a50570261197ec858130dbdb4739 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 = 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
+)
index 8f4566ef9bc128bb044a97cd9796614bfd26c398..3411e3ac40c387fb309c40627e1bd63615f6923e 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 freebsd || netbsd
+//go:build dragonfly || freebsd || netbsd
 
 package unix
 
index f0427db302bda9cf49595c364b5e32ca7c424f5d..19a2be587e4895a29ce0e15c48a80095680ddb5c 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 && !netbsd
+//go:build unix && !dragonfly && !freebsd && !linux && !netbsd
 
 package unix