From 4e15092006b105c92678b440167ae005bd8511eb Mon Sep 17 00:00:00 2001 From: Dave Cheney Date: Wed, 29 Jul 2015 19:36:55 +1000 Subject: syscall: use fchownat(2) in place of lchown(2) for linux/arm64 Fixes #11918 Replace calls to lchown(2) with fchownat(2) for linux/arm64 as the former is not suppored. This change has also landed on the x/sys repo as CL 12837. Change-Id: I58d4b144e051e36dd650ec9b7f3a02610ea943e5 Reviewed-on: https://go-review.googlesource.com/12833 Reviewed-by: Brad Fitzpatrick Reviewed-by: Ian Lance Taylor Reviewed-by: Dave Cheney Run-TryBot: Dave Cheney Reviewed-by: Russ Cox --- src/syscall/syscall_linux_arm64.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/syscall/syscall_linux_arm64.go') diff --git a/src/syscall/syscall_linux_arm64.go b/src/syscall/syscall_linux_arm64.go index 7ca4164544..3d55181150 100644 --- a/src/syscall/syscall_linux_arm64.go +++ b/src/syscall/syscall_linux_arm64.go @@ -16,7 +16,6 @@ const _SYS_dup = SYS_DUP3 //sysnb Getgid() (gid int) //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) //sysnb Getuid() (uid int) -//sys Lchown(path string, uid int, gid int) (err error) //sys Listen(s int, n int) (err error) //sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 @@ -37,6 +36,10 @@ func Stat(path string, stat *Stat_t) (err error) { return Fstatat(_AT_FDCWD, path, stat, 0) } +func Lchown(path string, uid int, gid int) (err error) { + return Fchownat(_AT_FDCWD, path, uid, gid, _AT_SYMLINK_NOFOLLOW) +} + func Lstat(path string, stat *Stat_t) (err error) { return Fstatat(_AT_FDCWD, path, stat, _AT_SYMLINK_NOFOLLOW) } -- cgit v1.3-5-g9baa