Commit 7a6e5648 authored by Steven Hartland's avatar Steven Hartland Committed by Ian Lance Taylor

unix: fix SysctlUint64 on 32bit machines

TestSysctlUint64 was using vm.max_kernel_address which is only 64bit
on 64bit machines or 32bit machines with PAE. Switch to using
security.mac.labeled which is a SYSCTL_UQUAD so 64bit on all platforms.

Also:
* Correct typo in test name.

Fixes golang/go#15186

Change-Id: I88b5b6ee6a04dec0730bca1e1f0e282f3c18d20d
Reviewed-on: https://go-review.googlesource.com/36058Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent d75a5265
......@@ -7,18 +7,14 @@
package unix_test
import (
"os"
"testing"
"golang.org/x/sys/unix"
)
func TestSysctUint64(t *testing.T) {
_, err := unix.SysctlUint64("vm.max_kernel_address")
func TestSysctlUint64(t *testing.T) {
_, err := unix.SysctlUint64("security.mac.labeled")
if err != nil {
if os.Getenv("GO_BUILDER_NAME") == "freebsd-386-gce101" {
t.Skipf("Ignoring known failing test (golang.org/issue/15186). Failed with: %v", err)
}
t.Fatal(err)
}
}
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