unix: remove StTimespec type on AIX

On AIX, Stat_t's fields dealing with time are of type StTimespec while
all other GOOS are using Timespec.
StTimespec and Timespec are the same on ppc but not in ppc64. Therefore,
values returned by ppc64 syscalls need to be adjusted in order to
allow the use of Timespec instead of StTimespec.

Fixes golang/go#32073

Change-Id: I0c212bf1741a27c49e995bf928d4941b6d583e54
Reviewed-on: https://go-review.googlesource.com/c/sys/+/177838
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Clément Chigot authored and Brad Fitzpatrick committed 2019-05-20 16:14:52 +00:00
1 parent 61b9204099
commit ad400b1274
13 files changed
+97 -40

No files matched your search

+2 -2
View File
@@ -107,10 +107,10 @@ func TestUtimesNanoAt(t *testing.T) {
t.Fatalf("Lstat: %v", err)
}
if runtime.GOARCH == "ppc64" {
if int64(st.Atim.Sec) != int64(ts[0].Sec) || st.Atim.Nsec != int32(ts[0].Nsec) {
if int64(st.Atim.Sec) != int64(ts[0].Sec) || st.Atim.Nsec != ts[0].Nsec {
t.Errorf("UtimesNanoAt: wrong atime: %v", st.Atim)
}
if int64(st.Mtim.Sec) != int64(ts[1].Sec) || st.Mtim.Nsec != int32(ts[1].Nsec) {
if int64(st.Mtim.Sec) != int64(ts[1].Sec) || st.Mtim.Nsec != ts[1].Nsec {
t.Errorf("UtimesNanoAt: wrong mtime: %v", st.Mtim)
}
} else {