cpu_fallback.go 714 B

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