syscall: enable ParseDirent for AIX
authorIan Lance Taylor <ian@gcc.gnu.org>
Wed, 20 Sep 2017 17:49:11 +0000 (17:49 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 20 Sep 2017 17:49:11 +0000 (17:49 +0000)
    Reviewed-on: https://go-review.googlesource.com/64990

From-SVN: r253022

gcc/go/gofrontend/MERGE
libgo/go/syscall/dirent.go
libgo/go/syscall/syscall_aix.go [new file with mode: 0644]
libgo/mksysinfo.sh

index 27b0be0..06f8d62 100644 (file)
@@ -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 4db2d43..a09bf05 100644 (file)
@@ -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
 
diff --git a/libgo/go/syscall/syscall_aix.go b/libgo/go/syscall/syscall_aix.go
new file mode 100644 (file)
index 0000000..c2554eb
--- /dev/null
@@ -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 54978b9..f7e88a6 100755 (executable)
@@ -485,6 +485,7 @@ fi | sed -e 's/type _dirent64/type Dirent/' \
          -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/' \