2024-02-17 03:48:29 +00:00
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2023-09-16 17:44:58 +08:00
|
|
|
//go:build !darwin && !linux && !freebsd && !openbsd && !netbsd && !solaris && !windows && !dragonfly && !plan9 && !aix
|
2016-08-22 15:31:26 -07:00
|
|
|
|
|
|
|
package cpu
|
|
|
|
|
|
|
|
import (
|
2017-12-31 15:25:49 +09:00
|
|
|
"context"
|
2019-03-03 14:38:33 +01:00
|
|
|
"runtime"
|
2017-12-31 15:25:49 +09:00
|
|
|
|
2024-02-17 03:48:29 +00:00
|
|
|
"github.com/shirou/gopsutil/v4/internal/common"
|
2016-08-22 15:31:26 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
func Times(percpu bool) ([]TimesStat, error) {
|
2017-12-31 15:25:49 +09:00
|
|
|
return TimesWithContext(context.Background(), percpu)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) {
|
2016-08-22 15:31:26 -07:00
|
|
|
return []TimesStat{}, common.ErrNotImplementedError
|
|
|
|
}
|
|
|
|
|
|
|
|
func Info() ([]InfoStat, error) {
|
2017-12-31 15:25:49 +09:00
|
|
|
return InfoWithContext(context.Background())
|
|
|
|
}
|
|
|
|
|
|
|
|
func InfoWithContext(ctx context.Context) ([]InfoStat, error) {
|
2016-08-22 15:31:26 -07:00
|
|
|
return []InfoStat{}, common.ErrNotImplementedError
|
|
|
|
}
|
2019-03-03 14:38:33 +01:00
|
|
|
|
|
|
|
func CountsWithContext(ctx context.Context, logical bool) (int, error) {
|
|
|
|
return runtime.NumCPU(), nil
|
|
|
|
}
|