unix: add SysctlClockinfo on dragonfly and freebsd

Change-Id: I0d439b5c59c79594c6ecfebe0375971e1344cc09
Reviewed-on: https://go-review.googlesource.com/c/sys/+/213400
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Tobias Klauser
2020-01-07 16:21:24 +00:00
committed by Tobias Klauser
parent ef85f5a75d
commit 548cf772de
15 changed files with 88 additions and 84 deletions
-15
View File
@@ -4,12 +4,6 @@
package unix_test
import (
"testing"
"golang.org/x/sys/unix"
)
// stringsFromByteSlice converts a sequence of attributes to a []string.
// On Darwin, each entry is a NULL-terminated string.
func stringsFromByteSlice(buf []byte) []string {
@@ -23,12 +17,3 @@ func stringsFromByteSlice(buf []byte) []string {
}
return result
}
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)
}