Commit 8d266165 by Ian Lance Taylor

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
parent ca2efef7
cb6fb7285bac72389bdce7ecfe87f9366022571a
b117b468264665cfe6ec2cf3affb48330a704fa7
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment