aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/zsyscall_linux_arm.go
diff options
context:
space:
mode:
authorKir Kolyshkin <kolyshkin@gmail.com>2022-06-30 15:19:59 -0700
committerTobias Klauser <tobias.klauser@gmail.com>2022-09-01 22:00:28 +0000
commit4048f3ffb6b74fef0a7e0e2f9d47bc944d805578 (patch)
treefecd1de7ddd4de591e0965878c792506c48bcaa1 /src/syscall/zsyscall_linux_arm.go
parent36f191abcd633a7795195adf89153cc7f373c90f (diff)
downloadgo-4048f3ffb6b74fef0a7e0e2f9d47bc944d805578.tar.xz
syscall: Faccessat: use faccessat2 on linux
Linux kernel 5.8 added the faccessat2 syscall taking a flags argument. Attempt to use it in Faccessat and fall back to the existing implementation mimicking glibc faccessat. Do not export the new syscall value so we keep syscall API intact. Part of this commit is generated by: GOOS=linux ./mkall.sh -syscalls zsyscall_linux_*.go This is similar to [1] amended by [2]. Required for [3]. [1] https://go-review.googlesource.com/c/sys/+/246537 [2] https://go-review.googlesource.com/c/sys/+/246817 [3] https://go-review.googlesource.com/c/go/+/414824 Co-authored-by: Tobias Klauser <tklauser@distanz.ch> Change-Id: Ib7fe5ba853c15d92e869df9a16b56b79b96e43a6 Reviewed-on: https://go-review.googlesource.com/c/go/+/416115 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src/syscall/zsyscall_linux_arm.go')
-rw-r--r--src/syscall/zsyscall_linux_arm.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/syscall/zsyscall_linux_arm.go b/src/syscall/zsyscall_linux_arm.go
index 577655d002..db5ec60448 100644
--- a/src/syscall/zsyscall_linux_arm.go
+++ b/src/syscall/zsyscall_linux_arm.go
@@ -24,6 +24,21 @@ func faccessat(dirfd int, path string, mode uint32) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func faccessat2(dirfd int, path string, mode uint32, flags int) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(path)
+ if err != nil {
+ return
+ }
+ _, _, e1 := Syscall6(_SYS_faccessat2, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func fchmodat(dirfd int, path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)