aboutsummaryrefslogtreecommitdiff
path: root/libgo/go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-04-26 17:20:55 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-04-26 17:20:55 +0000
commit8d266165b9c1b303efab1881120b9d5a6feb437a (patch)
tree17d3ae67a1b9be4cc4873eb79698c260cdc76687 /libgo/go
parentca2efef75d700d651af8e5df61b014ed7c01b350 (diff)
downloadgcc-8d266165b9c1b303efab1881120b9d5a6feb437a.zip
gcc-8d266165b9c1b303efab1881120b9d5a6feb437a.tar.gz
gcc-8d266165b9c1b303efab1881120b9d5a6feb437a.tar.bz2
runtime: fix TestPhysPageSize on AIX
AIX doesn't allow to mmap an address range which is already mmap. Therefore, once the region has been allocated, it must munmap before being able to play with it. The corresponding Go Toolchain patch is CL 174059. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/174138 From-SVN: r270615
Diffstat (limited to 'libgo/go')
-rw-r--r--libgo/go/runtime/runtime_mmap_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/libgo/go/runtime/runtime_mmap_test.go b/libgo/go/runtime/runtime_mmap_test.go
index c004041..188fd5d 100644
--- a/libgo/go/runtime/runtime_mmap_test.go
+++ b/libgo/go/runtime/runtime_mmap_test.go
@@ -32,6 +32,11 @@ func TestPhysPageSize(t *testing.T) {
t.Fatalf("Mmap: %v", err)
}
+ if runtime.GOOS == "aix" {
+ // AIX does not allow mapping a range that is already mapped.
+ runtime.Munmap(unsafe.Pointer(uintptr(b)), 2*ps)
+ }
+
// Mmap should fail at a half page into the buffer.
_, err = runtime.Mmap(unsafe.Pointer(uintptr(b)+ps/2), ps, 0, runtime.MAP_ANON|runtime.MAP_PRIVATE|runtime.MAP_FIXED, -1, 0)
if err == 0 {