From b09fb700fbb73bb06b1863b5741a67ef6dbfa433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Fri, 16 Oct 2020 09:03:17 +0200 Subject: [PATCH] unix: add missing syscalls on AIX Access, Chmod, Chown and Creat were forgotten when porting the package on AIX. Fixes golang/go#42001 Change-Id: I1ab8c5198240421b31db8b447fe37ce5d80e5ce8 Reviewed-on: https://go-review.googlesource.com/c/sys/+/262897 Trust: Tobias Klauser Run-TryBot: Tobias Klauser TryBot-Result: Go Bot Reviewed-by: Tobias Klauser Reviewed-by: Ian Lance Taylor --- unix/syscall_aix.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/unix/syscall_aix.go b/unix/syscall_aix.go index 9ad8a0d4..44081538 100644 --- a/unix/syscall_aix.go +++ b/unix/syscall_aix.go @@ -19,6 +19,22 @@ import "unsafe" * Wrapped */ +func Access(path string, mode uint32) (err error) { + return Faccessat(AT_FDCWD, path, mode, 0) +} + +func Chmod(path string, mode uint32) (err error) { + return Fchmodat(AT_FDCWD, path, mode, 0) +} + +func Chown(path string, uid int, gid int) (err error) { + return Fchownat(AT_FDCWD, path, uid, gid, 0) +} + +func Creat(path string, mode uint32) (fd int, err error) { + return Open(path, O_CREAT|O_WRONLY|O_TRUNC, mode) +} + //sys utimes(path string, times *[2]Timeval) (err error) func Utimes(path string, tv []Timeval) error { if len(tv) != 2 {