cpu_fallback.go 838 B

12345678910111213141516171819202122232425262728293031
  1. //go:build !darwin && !linux && !freebsd && !openbsd && !solaris && !windows && !dragonfly && !plan9 && !aix
  2. // +build !darwin,!linux,!freebsd,!openbsd,!solaris,!windows,!dragonfly,!plan9,!aix
  3. package cpu
  4. import (
  5. "context"
  6. "runtime"
  7. "github.com/shirou/gopsutil/v3/internal/common"
  8. )
  9. func Times(percpu bool) ([]TimesStat, error) {
  10. return TimesWithContext(context.Background(), percpu)
  11. }
  12. func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) {
  13. return []TimesStat{}, common.ErrNotImplementedError
  14. }
  15. func Info() ([]InfoStat, error) {
  16. return InfoWithContext(context.Background())
  17. }
  18. func InfoWithContext(ctx context.Context) ([]InfoStat, error) {
  19. return []InfoStat{}, common.ErrNotImplementedError
  20. }
  21. func CountsWithContext(ctx context.Context, logical bool) (int, error) {
  22. return runtime.NumCPU(), nil
  23. }