mirror of https://github.com/golang/go.git
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>
This commit is contained in:
parent
fcb9d6b5d0
commit
310984bf54
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue