aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/stubs2.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2017-06-06 15:08:59 -0700
committerIan Lance Taylor <iant@golang.org>2017-06-06 23:26:55 +0000
commitf425f549573e5017861216d62ccb22ee37b68004 (patch)
treea5dc94df90194f08092676258a4079650564b4f5 /src/runtime/stubs2.go
parent557f6a13beb9e2da58d439d228e7f8f838c61159 (diff)
downloadgo-f425f549573e5017861216d62ccb22ee37b68004.tar.gz
go-f425f549573e5017861216d62ccb22ee37b68004.zip
runtime: intercept munmap as we do mmap
For cgo programs on linux-amd64 we call the C function mmap. This supports programs such as the C memory sanitizer that need to intercept all calls to mmap. It turns out that there are programs that intercept both mmap and munmap, or that at least expect that if they intercept mmap, they also intercept munmap. So, if we permit mmap to be intercepted, also permit munmap to be intercepted. No test, as it requires two odd things: a C program that intercepts mmap and munmap, and a Go program that calls munmap. Change-Id: Iec33f47d59f70dbb7463fd12d30728c24cd4face Reviewed-on: https://go-review.googlesource.com/45016 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/stubs2.go')
-rw-r--r--src/runtime/stubs2.go2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/runtime/stubs2.go b/src/runtime/stubs2.go
index 95db924d5a..8390d8fca9 100644
--- a/src/runtime/stubs2.go
+++ b/src/runtime/stubs2.go
@@ -18,8 +18,6 @@ func exit(code int32)
func nanotime() int64
func usleep(usec uint32)
-func munmap(addr unsafe.Pointer, n uintptr)
-
//go:noescape
func write(fd uintptr, p unsafe.Pointer, n int32) int32