This libgo patch from Tony Reix enables ParseDirent for AIX. Bootstrapped on x86_64-pc-linux-gnu. Committed to mainline.
Ian
Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 253021) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -84f827669dc76326ed99ebcc982c482aa148d8d8 +5deeab42b0e5fdf2721773ce7fdaf61716599d4d The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: libgo/go/syscall/dirent.go =================================================================== --- libgo/go/syscall/dirent.go (revision 251948) +++ libgo/go/syscall/dirent.go (working copy) @@ -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 darwin dragonfly freebsd linux nacl netbsd openbsd solaris +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris package syscall Index: libgo/go/syscall/syscall_aix.go =================================================================== --- libgo/go/syscall/syscall_aix.go (revision 0) +++ libgo/go/syscall/syscall_aix.go (working copy) @@ -0,0 +1,19 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package syscall + +import "unsafe" + +func direntIno(buf []byte) (uint64, bool) { + return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino)) +} + +func direntReclen(buf []byte) (uint64, bool) { + return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen)) +} + +func direntNamlen(buf []byte) (uint64, bool) { + return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen)) +} Index: libgo/mksysinfo.sh =================================================================== --- libgo/mksysinfo.sh (revision 251948) +++ libgo/mksysinfo.sh (working copy) @@ -485,6 +485,7 @@ fi | sed -e 's/type _dirent64/type Diren -e 's/d_name/Name/' \ -e 's/]int8/]byte/' \ -e 's/d_ino/Ino/' \ + -e 's/d_namlen/Namlen/' \ -e 's/d_off/Off/' \ -e 's/d_reclen/Reclen/' \ -e 's/d_type/Type/' \