mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-03 23:57:32 -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
@@ -33,3 +33,10 @@ func TestGetfsstat(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestSysctlRaw(t *testing.T) {
|
||||
_, err := unix.SysctlRaw("kern.proc.pid", unix.Getpid())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user