mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-03 15:47:35 -04:00
unix: add SysctlClockinfo on darwin
Add type Clockinfo and the SysctlClockinfo function to query clock rate information from the kernel. Change-Id: Ic29edcacee3b3f6125bb218b82c2a2496c39213a Reviewed-on: https://go-review.googlesource.com/c/sys/+/170297 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
9eb1bfa1ce
commit
e4093980e8
@@ -61,3 +61,12 @@ func TestUtimesNanoAt(t *testing.T) {
|
||||
t.Errorf("UtimesNanoAt: wrong mtime: got %v, expected %v", st.Mtimespec, expected)
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user