mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-05 08:37:31 -04:00
unix: add custom Sysctl args and methods SysctlUint64, SysctlRaw
Add support for optional sysctl arguments which is required to support sysctls that require more than the mib identifer args as returned from nametomib such as kern.proc.pid. Add SysctlUint64 which allows sysctls that return 64 bit ints to be queried. Add SysctlRaw which allows sysctls that return structs or other unsupported types to be queried. Change-Id: If0fa23935ee09496f2df210364d8988ccd0f3db6 Reviewed-on: https://go-review.googlesource.com/14955 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
committed by
Ian Lance Taylor
parent
354f231ae1
commit
d9157a9621
@@ -0,0 +1,20 @@
|
||||
// Copyright 2014 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build freebsd
|
||||
|
||||
package unix_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func TestSysctUint64(t *testing.T) {
|
||||
_, err := unix.SysctlUint64("vm.max_kernel_address")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user