aboutsummaryrefslogtreecommitdiff
path: root/src/archive
diff options
context:
space:
mode:
authorClément Chigot <clement.chigot@atos.net>2019-02-21 11:27:41 +0100
committerIan Lance Taylor <iant@golang.org>2019-02-27 23:40:20 +0000
commit8e8abf368d5b8050f40408b23a4027824351f674 (patch)
tree147c78fefac22c24947d80d40f02d6ae5d1c71a4 /src/archive
parentd3631955d454a8cfc0b63065ef1cc4c8db64ae46 (diff)
downloadgo-8e8abf368d5b8050f40408b23a4027824351f674.tar.gz
go-8e8abf368d5b8050f40408b23a4027824351f674.zip
archive/tar, syscall: add statUnix for aix/ppc64
This commit add statUnix function for aix/ppc64. It also adds Unix and Nano methods for AIX time structure. Change-Id: I9fd62d34a47e87cd46f2f936cb736da0bdff7959 Reviewed-on: https://go-review.googlesource.com/c/163957 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/archive')
-rw-r--r--src/archive/tar/stat_actime1.go2
-rw-r--r--src/archive/tar/stat_unix.go7
2 files changed, 7 insertions, 2 deletions
diff --git a/src/archive/tar/stat_actime1.go b/src/archive/tar/stat_actime1.go
index cf9cc79c59..1bdd1c9dcb 100644
--- a/src/archive/tar/stat_actime1.go
+++ b/src/archive/tar/stat_actime1.go
@@ -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 linux dragonfly openbsd solaris
+// +build aix linux dragonfly openbsd solaris
package tar
diff --git a/src/archive/tar/stat_unix.go b/src/archive/tar/stat_unix.go
index 868105f338..d1576db41d 100644
--- a/src/archive/tar/stat_unix.go
+++ b/src/archive/tar/stat_unix.go
@@ -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 linux darwin dragonfly freebsd openbsd netbsd solaris
+// +build aix linux darwin dragonfly freebsd openbsd netbsd solaris
package tar
@@ -54,6 +54,11 @@ func statUnix(fi os.FileInfo, h *Header) error {
if h.Typeflag == TypeChar || h.Typeflag == TypeBlock {
dev := uint64(sys.Rdev) // May be int32 or uint32
switch runtime.GOOS {
+ case "aix":
+ var major, minor uint32
+ major = uint32((dev & 0x3fffffff00000000) >> 32)
+ minor = uint32((dev & 0x00000000ffffffff) >> 0)
+ h.Devmajor, h.Devminor = int64(major), int64(minor)
case "linux":
// Copied from golang.org/x/sys/unix/dev_linux.go.
major := uint32((dev & 0x00000000000fff00) >> 8)