Skip to content

Commit b09fb70

Browse files
Helflymianlancetaylor
authored andcommitted
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 <[email protected]> Run-TryBot: Tobias Klauser <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Tobias Klauser <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent f659759 commit b09fb70

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

unix/syscall_aix.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,22 @@ import "unsafe"
1919
* Wrapped
2020
*/
2121

22+
func Access(path string, mode uint32) (err error) {
23+
return Faccessat(AT_FDCWD, path, mode, 0)
24+
}
25+
26+
func Chmod(path string, mode uint32) (err error) {
27+
return Fchmodat(AT_FDCWD, path, mode, 0)
28+
}
29+
30+
func Chown(path string, uid int, gid int) (err error) {
31+
return Fchownat(AT_FDCWD, path, uid, gid, 0)
32+
}
33+
34+
func Creat(path string, mode uint32) (fd int, err error) {
35+
return Open(path, O_CREAT|O_WRONLY|O_TRUNC, mode)
36+
}
37+
2238
//sys utimes(path string, times *[2]Timeval) (err error)
2339
func Utimes(path string, tv []Timeval) error {
2440
if len(tv) != 2 {

0 commit comments

Comments
 (0)