Documentation
¶
Overview ¶
Package sysfs reads attributes from the sysfs filesystem.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidReadCount = errors.New("invalid read count")
ErrInvalidReadCount is returned when a read reports a byte count outside the buffer it was given.
A sysfs show() callback returning a negative value which is not an errno makes read(2) return it as is, and the Go standard library passes it through as the byte count, so os.ReadFile and io.ReadAll panic with "slice bounds out of range".
Functions ¶
func CPUFreqStats ¶
func CPUFreqStats(root string) ([]*machine.CPUFreqStats, error)
CPUFreqStats returns the current, minimum and maximum frequency (in kHz) and the governor of each online CPU, in CPU number order, read from sysfs mounted at root.
A CPU which has no cpufreq policy, or whose frequency cannot be read, gets empty stats.
Types ¶
This section is empty.