aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/syscall
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2017-09-20 17:49:11 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2017-09-20 17:49:11 +0000
commit836cccc71d0aef7308b8f4c02214ac2ed2f3643d (patch)
tree82dcae6f5ac5192681ca1a7bae742762806f19ec /libgo/go/syscall
parent5e525857e9a7390d9a90de91618b133ab6051a9d (diff)
downloadgcc-836cccc71d0aef7308b8f4c02214ac2ed2f3643d.zip
gcc-836cccc71d0aef7308b8f4c02214ac2ed2f3643d.tar.gz
gcc-836cccc71d0aef7308b8f4c02214ac2ed2f3643d.tar.bz2
syscall: enable ParseDirent for AIX
Reviewed-on: https://go-review.googlesource.com/64990 From-SVN: r253022
Diffstat (limited to 'libgo/go/syscall')
-rw-r--r--libgo/go/syscall/dirent.go2
-rw-r--r--libgo/go/syscall/syscall_aix.go19
2 files changed, 20 insertions, 1 deletions
diff --git a/libgo/go/syscall/dirent.go b/libgo/go/syscall/dirent.go
index 4db2d43..a09bf05 100644
--- a/libgo/go/syscall/dirent.go
+++ b/libgo/go/syscall/dirent.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 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
index 0000000..c2554eb
--- /dev/null
+++ b/libgo/go/syscall/syscall_aix.go
@@ -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))
+}