shirou_gopsutil/load/load_openbsd.go

19 lines
280 B
Go
Raw Normal View History

2021-12-23 05:54:41 +08:00
//go:build openbsd
2020-09-12 10:35:21 +08:00
// +build openbsd
package load
import (
"unsafe"
"golang.org/x/sys/unix"
)
func getForkStat() (forkstat, error) {
b, err := unix.SysctlRaw("kern.forkstat")
if err != nil {
return forkstat{}, err
}
return *(*forkstat)(unsafe.Pointer((&b[0]))), nil
}