aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/syscall
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-04-30 16:04:17 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-04-30 16:04:17 +0000
commit81b9589421788a06088f1a703100328800e9e9ec (patch)
treeb3c2a101bbc4c5c762bad8d1393ba9442396afd2 /libgo/go/syscall
parentb944e97a922d85b404cba6c4a4f2fbcf8e7701b8 (diff)
downloadgcc-81b9589421788a06088f1a703100328800e9e9ec.zip
gcc-81b9589421788a06088f1a703100328800e9e9ec.tar.gz
gcc-81b9589421788a06088f1a703100328800e9e9ec.tar.bz2
re PR go/52586 (libgo fails to build for mips*64-linux-gnu (reference to undefined name 'SYS_GETDENTS64'))
PR go/52586 mksysinfo, syscall: Make sure SYS_GETDENTS64 is defined. Fixes build on MIPS GNU/Linux. From-SVN: r186986
Diffstat (limited to 'libgo/go/syscall')
-rw-r--r--libgo/go/syscall/libcall_linux.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/libgo/go/syscall/libcall_linux.go b/libgo/go/syscall/libcall_linux.go
index 7c9f05e..8d7da19 100644
--- a/libgo/go/syscall/libcall_linux.go
+++ b/libgo/go/syscall/libcall_linux.go
@@ -203,7 +203,11 @@ func Getdents(fd int, buf []byte) (n int, err error) {
p = (*byte)(unsafe.Pointer(&_zero))
}
Entersyscall()
- r1, _, errno := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(len(buf)))
+ s := SYS_GETDENTS64
+ if s == 0 {
+ s = SYS_GETDENTS
+ }
+ r1, _, errno := Syscall(uintptr(s), uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(len(buf)))
n = int(r1)
if n < 0 {
err = errno