From b3a7fdc3eadb551659dedf47c2a6faf0d569a278 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 12 May 2017 00:59:15 +0000 Subject: [PATCH] os: use opendir64 and closedir64 on AIX When using readdir64 on AIX, we must also use opendir64 and closedir64. Issue golang/go#19200 Reviewed-on: https://go-review.googlesource.com/43251 From-SVN: r247947 --- gcc/go/gofrontend/MERGE | 2 +- libgo/go/os/dir_gccgo.go | 6 ------ libgo/go/os/dir_libc64_gccgo.go | 15 +++++++++++++++ libgo/go/os/dir_libc_gccgo.go | 15 +++++++++++++++ 4 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 libgo/go/os/dir_libc64_gccgo.go create mode 100644 libgo/go/os/dir_libc_gccgo.go diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index a0e661bd61b..27f42275e0d 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -619848ccd463ac385e9912df008e7e8e6301a284 +fc3d6af694c518d73a126bcbd90d79982524f9f6 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/go/os/dir_gccgo.go b/libgo/go/os/dir_gccgo.go index 8923f0e47ae..f66064670df 100644 --- a/libgo/go/os/dir_gccgo.go +++ b/libgo/go/os/dir_gccgo.go @@ -12,12 +12,6 @@ import ( "unsafe" ) -//extern opendir -func libc_opendir(*byte) *syscall.DIR - -//extern closedir -func libc_closedir(*syscall.DIR) int - // FIXME: pathconf returns long, not int. //extern pathconf func libc_pathconf(*byte, int) int diff --git a/libgo/go/os/dir_libc64_gccgo.go b/libgo/go/os/dir_libc64_gccgo.go new file mode 100644 index 00000000000..95d46634c17 --- /dev/null +++ b/libgo/go/os/dir_libc64_gccgo.go @@ -0,0 +1,15 @@ +// 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. + +// +build aix + +package os + +import "syscall" + +//extern opendir64 +func libc_opendir(*byte) *syscall.DIR + +//extern closedir64 +func libc_closedir(*syscall.DIR) int diff --git a/libgo/go/os/dir_libc_gccgo.go b/libgo/go/os/dir_libc_gccgo.go new file mode 100644 index 00000000000..1ee253c2a77 --- /dev/null +++ b/libgo/go/os/dir_libc_gccgo.go @@ -0,0 +1,15 @@ +// 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. + +// +build !aix + +package os + +import "syscall" + +//extern opendir +func libc_opendir(*byte) *syscall.DIR + +//extern closedir +func libc_closedir(*syscall.DIR) int -- 2.30.2