]> Cypherpunks repositories - gostls13.git/commit
runtime: use mprotect in sysMap for aix/ppc64
authorClément Chigot <chigot.c@gmail.com>
Thu, 14 Nov 2019 14:43:55 +0000 (15:43 +0100)
committerAustin Clements <austin@google.com>
Mon, 9 Dec 2019 16:41:15 +0000 (16:41 +0000)
commita3a630b0d2829ab74ac623fc2ae92864bd61d391
tree85cb59865cae298963be0dfccc27443374d80e33
parent590052ba29a6853683533f916284db39f935e4e6
runtime: use mprotect in sysMap for aix/ppc64

AIX doesn't allow to mmap an already mmap address. The previous way to
deal with this behavior was to munmap before calling mmap again.
However, mprotect syscall is able to change protections on a memory
range. Thus, memory mapped by sysReserve can be remap using it. Note
that sysMap is always called with a non-nil pointer so mprotect is
always possible.

Updates: #35451

Change-Id: I1fd1e1363d9ed9eb5a8aa7c8242549bd6dad8cd0
Reviewed-on: https://go-review.googlesource.com/c/go/+/207237
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/runtime/mem_aix.go
src/runtime/os2_aix.go