mirror of https://github.com/shirou/gopsutil
syscall.SysInfo not exists in FreeBSD. use sysctl instead.
parent
d99b3db367
commit
e3f496f4fe
@ -0,0 +1,20 @@
|
||||
// +build freebsd
|
||||
|
||||
package gopsutil
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func do_sysctrl(mib string) ([]string, error){
|
||||
out, err := exec.Command("/sbin/sysctl", "-n", mib).Output()
|
||||
if err != nil {
|
||||
return []string{}, err
|
||||
}
|
||||
v := strings.Replace(string(out), "{ ", "", 1)
|
||||
v = strings.Replace(string(v), " }", "", 1)
|
||||
values := strings.Fields(string(v))
|
||||
|
||||
return values, nil
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
// +build freebsd
|
||||
|
||||
package gopsutil
|
||||
|
||||
func Virtual_memory() (Virtual_memoryStat, error) {
|
||||
ret := Virtual_memoryStat{}
|
||||
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
func Swap_memory() (Swap_memoryStat, error) {
|
||||
ret := Swap_memoryStat{}
|
||||
|
||||
return ret, nil
|
||||
}
|
Loading…
Reference in New Issue