From: Tobias Klauser Date: Wed, 4 Oct 2023 16:07:37 +0000 (+0200) Subject: internal/syscall/unix: implement Eaccess on dragonfly X-Git-Tag: go1.22rc1~666 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ad76a98d5e4bb0632333dafaf850094b15a357a1;p=gostls13.git internal/syscall/unix: implement Eaccess on dragonfly 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 Auto-Submit: Tobias Klauser Run-TryBot: Tobias Klauser LUCI-TryBot-Result: Go LUCI TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor --- diff --git a/src/internal/syscall/unix/at_sysnum_dragonfly.go b/src/internal/syscall/unix/at_sysnum_dragonfly.go index b7ed3f732b..9ac1f919f1 100644 --- a/src/internal/syscall/unix/at_sysnum_dragonfly.go +++ b/src/internal/syscall/unix/at_sysnum_dragonfly.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 = 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 +) diff --git a/src/internal/syscall/unix/eaccess_bsd.go b/src/internal/syscall/unix/eaccess_bsd.go index 8f4566ef9b..3411e3ac40 100644 --- a/src/internal/syscall/unix/eaccess_bsd.go +++ b/src/internal/syscall/unix/eaccess_bsd.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 freebsd || netbsd +//go:build dragonfly || freebsd || netbsd package unix diff --git a/src/internal/syscall/unix/eaccess_other.go b/src/internal/syscall/unix/eaccess_other.go index f0427db302..19a2be587e 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 && !netbsd +//go:build unix && !dragonfly && !freebsd && !linux && !netbsd package unix