shirou_gopsutil/cpu/cpu_fallback.go

31 lines
714 B
Go
Raw Normal View History

2020-06-18 16:17:23 +08:00
// +build !darwin,!linux,!freebsd,!openbsd,!solaris,!windows,!dragonfly
package cpu
import (
2017-12-31 14:25:49 +08:00
"context"
"runtime"
2017-12-31 14:25:49 +08:00
"github.com/shirou/gopsutil/internal/common"
)
func Times(percpu bool) ([]TimesStat, error) {
2017-12-31 14:25:49 +08:00
return TimesWithContext(context.Background(), percpu)
}
func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) {
return []TimesStat{}, common.ErrNotImplementedError
}
func Info() ([]InfoStat, error) {
2017-12-31 14:25:49 +08:00
return InfoWithContext(context.Background())
}
func InfoWithContext(ctx context.Context) ([]InfoStat, error) {
return []InfoStat{}, common.ErrNotImplementedError
}
func CountsWithContext(ctx context.Context, logical bool) (int, error) {
return runtime.NumCPU(), nil
}