mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-30 13:56:45 -04:00
unix: add SysctlClockinfo on OpenBSD
OpenBSD (like NetBSD) uses sysctl with struct clockinfo to get clock rate information from the kernel. Add type Clockinfo and the SysctlClockinfo function to query this information. Change-Id: I35070a82b8de23dcd7592e8654dcc5eeee143b5b Reviewed-on: https://go-review.googlesource.com/c/sys/+/168057 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matt Layher <mdlayher@gmail.com>
This commit is contained in:
committed by
Tobias Klauser
parent
a2f829d7f3
commit
6c81ef8f67
@@ -40,6 +40,15 @@ func TestPpoll(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSysctlClockinfo(t *testing.T) {
|
||||
ci, err := unix.SysctlClockinfo("kern.clockrate")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Logf("tick = %v, tickadj = %v, hz = %v, profhz = %v, stathz = %v",
|
||||
ci.Tick, ci.Tickadj, ci.Hz, ci.Profhz, ci.Stathz)
|
||||
}
|
||||
|
||||
func TestSysctlUvmexp(t *testing.T) {
|
||||
uvm, err := unix.SysctlUvmexp("vm.uvmexp")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user