]> Cypherpunks repositories - gostls13.git/commitdiff
syscall, cmd/go/internal/modload: add and use Access on aix
authorTobias Klauser <tklauser@distanz.ch>
Mon, 19 Oct 2020 10:01:23 +0000 (12:01 +0200)
committerTobias Klauser <tobias.klauser@gmail.com>
Tue, 20 Oct 2020 07:33:13 +0000 (07:33 +0000)
Implement Access using Faccessat on aix following golang.org/x/sys/unix
CL 262897 and switch cmd/go/internal/modload to use it to implement
hasWritePerm.

Change-Id: I682e44737ac2bac5a203ac1c9ddd277810454426
Reviewed-on: https://go-review.googlesource.com/c/go/+/263540
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/modload/stat_openfile.go
src/cmd/go/internal/modload/stat_unix.go
src/syscall/syscall_aix.go

index 7cdeaf47a2f8b30e7cf214cbde34bd61329220bb..5842b858f0b1a48a1b2b78b404a574cabf6d58da 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.
 
-// +build aix js,wasm plan9
+// +build js,wasm plan9
 
 // On plan9, per http://9p.io/magic/man2html/2/access: “Since file permissions
 // are checked by the server and group information is not known to the client,
index 65068444d06323b5b83bc6fb1cec3c636f3fa406..f49278ec3a8341668f35711cfc7eaae3f9775e89 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.
 
-// +build darwin dragonfly freebsd linux netbsd openbsd solaris
+// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
 
 package modload
 
index 8837dd5a7f33aba5e1abd61bc83fe3abfbad181d..9c6afba442e2f2adf2227fb05845af8aeee9ddc4 100644 (file)
@@ -45,6 +45,10 @@ func (ts *StTimespec_t) Nano() int64 {
  * Wrapped
  */
 
+func Access(path string, mode uint32) (err error) {
+       return Faccessat(_AT_FDCWD, path, mode, 0)
+}
+
 // fcntl must never be called with cmd=F_DUP2FD because it doesn't work on AIX
 // There is no way to create a custom fcntl and to keep //sys fcntl easily,
 // because we need fcntl name for its libc symbol. This is linked with the script.