aboutsummaryrefslogtreecommitdiff
path: root/src/syscall
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2020-10-19 12:01:23 +0200
committerTobias Klauser <tobias.klauser@gmail.com>2020-10-20 07:33:13 +0000
commit310984bf54a52b15085e195a402873ab558d34d4 (patch)
tree38ca9f76164f336d4eb6c30bc109608fc61b30d9 /src/syscall
parentfcb9d6b5d0ba6f5606c2b5dfc09f75e2dc5fc1e5 (diff)
downloadgo-310984bf54a52b15085e195a402873ab558d34d4.tar.gz
go-310984bf54a52b15085e195a402873ab558d34d4.zip
syscall, cmd/go/internal/modload: add and use Access on aix
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>
Diffstat (limited to 'src/syscall')
-rw-r--r--src/syscall/syscall_aix.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/syscall/syscall_aix.go b/src/syscall/syscall_aix.go
index 8837dd5a7f..9c6afba442 100644
--- a/src/syscall/syscall_aix.go
+++ b/src/syscall/syscall_aix.go
@@ -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.