diff options
author | Austin Clements <austin@google.com> | 2016-07-18 22:00:45 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2016-09-06 21:05:55 +0000 |
commit | 1b9499b06989d2831e5b156161d6c07642926ee1 (patch) | |
tree | d234d376074e30e9e315af495d2ed55cb86a2779 /src/runtime/runtime.go | |
parent | 6dda7b2f5fb675a2747fea5ae020248245b8903f (diff) | |
download | go-1b9499b06989d2831e5b156161d6c07642926ee1.tar.gz go-1b9499b06989d2831e5b156161d6c07642926ee1.zip |
syscall: make Getpagesize return page size from runtime
syscall.Getpagesize currently returns hard-coded page sizes on all
architectures (some of which are probably always wrong, and some of
which are definitely not always right). The runtime now has this
information, queried from the OS during runtime init, so make
syscall.Getpagesize return the page size that the runtime knows.
Updates #10180.
Change-Id: I4daa6fbc61a2193eb8fa9e7878960971205ac346
Reviewed-on: https://go-review.googlesource.com/25051
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/runtime/runtime.go')
-rw-r--r-- | src/runtime/runtime.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/runtime.go b/src/runtime/runtime.go index d9c26ccb12..d8fe2f451f 100644 --- a/src/runtime/runtime.go +++ b/src/runtime/runtime.go @@ -52,5 +52,8 @@ var argslice []string //go:linkname syscall_runtime_envs syscall.runtime_envs func syscall_runtime_envs() []string { return append([]string{}, envs...) } +//go:linkname syscall_Getpagesize syscall.Getpagesize +func syscall_Getpagesize() int { return int(physPageSize) } + //go:linkname os_runtime_args os.runtime_args func os_runtime_args() []string { return append([]string{}, argslice...) } |