1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-26 13:48:59 +08:00
shirou_gopsutil/host/host_posix.go

16 lines
280 B
Go
Raw Normal View History

// +build linux freebsd openbsd darwin solaris
package host
import (
2019-08-12 13:32:14 -07:00
"bytes"
"golang.org/x/sys/unix"
)
2020-09-11 14:51:20 +03:00
func KernelArch() (string, error) {
var utsname unix.Utsname
err := unix.Uname(&utsname)
2019-08-12 13:32:14 -07:00
return string(utsname.Machine[:bytes.IndexByte(utsname.Machine[:], 0)]), err
}