aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/internal
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-03-09 02:10:22 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-03-09 02:10:22 +0000
commitee973155b2fd00dfe0ef6a3563c9623512f6632e (patch)
treeb6c85d9bbcbcafc6c5236cc9b99d04b65f281cdf /libgo/go/internal
parent9c0aa28c4818ab2477910dacdfdceb3cb33c8629 (diff)
downloadgcc-ee973155b2fd00dfe0ef6a3563c9623512f6632e.zip
gcc-ee973155b2fd00dfe0ef6a3563c9623512f6632e.tar.gz
gcc-ee973155b2fd00dfe0ef6a3563c9623512f6632e.tar.bz2
re PR go/89447 (libgo largefile support is incomplete and inconsistent)
PR go/89447 syscall, internal/syscall: adjust use of largefile functions Consistently call __go_openat for openat. Use fstatat64, creat64, sendfile64, and getdents64 where needed. Based on patch by Rainer Orth. Fixes https://gcc.gnu.org/PR89447 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/166420 From-SVN: r269521
Diffstat (limited to 'libgo/go/internal')
-rw-r--r--libgo/go/internal/syscall/unix/at.go5
-rw-r--r--libgo/go/internal/syscall/unix/at_largefile.go14
-rw-r--r--libgo/go/internal/syscall/unix/at_regfile.go18
3 files changed, 33 insertions, 4 deletions
diff --git a/libgo/go/internal/syscall/unix/at.go b/libgo/go/internal/syscall/unix/at.go
index b57b791..a602d3a 100644
--- a/libgo/go/internal/syscall/unix/at.go
+++ b/libgo/go/internal/syscall/unix/at.go
@@ -13,12 +13,9 @@ import (
//extern unlinkat
func unlinkat(int32, *byte, int32) int32
-//extern openat
+//extern __go_openat
func openat(int32, *byte, int32, syscall.Mode_t) int32
-//extern fstatat
-func fstatat(int32, *byte, *syscall.Stat_t, int32) int32
-
func Unlinkat(dirfd int, path string, flags int) error {
var p *byte
p, err := syscall.BytePtrFromString(path)
diff --git a/libgo/go/internal/syscall/unix/at_largefile.go b/libgo/go/internal/syscall/unix/at_largefile.go
new file mode 100644
index 0000000..5318d23
--- /dev/null
+++ b/libgo/go/internal/syscall/unix/at_largefile.go
@@ -0,0 +1,14 @@
+// Copyright 2019 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 hurd linux solaris,386 solaris,sparc
+
+package unix
+
+import (
+ "syscall"
+)
+
+//extern fstatat64
+func fstatat(int32, *byte, *syscall.Stat_t, int32) int32
diff --git a/libgo/go/internal/syscall/unix/at_regfile.go b/libgo/go/internal/syscall/unix/at_regfile.go
new file mode 100644
index 0000000..004c801
--- /dev/null
+++ b/libgo/go/internal/syscall/unix/at_regfile.go
@@ -0,0 +1,18 @@
+// Copyright 2019 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
+// +build !hurd
+// +build !linux
+// +build !solaris !386
+// +build !solaris !sparc
+
+package unix
+
+import (
+ "syscall"
+)
+
+//extern fstatat
+func fstatat(int32, *byte, *syscall.Stat_t, int32) int32