2020-07-01 12:47:56 +00:00
|
|
|
// +build linux freebsd openbsd darwin solaris
|
|
|
|
|
|
|
|
package host
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
|
|
|
|
"golang.org/x/sys/unix"
|
|
|
|
)
|
|
|
|
|
2020-10-07 16:57:18 +00:00
|
|
|
func KernelArch() (string, error) {
|
2020-07-01 12:47:56 +00:00
|
|
|
var utsname unix.Utsname
|
|
|
|
err := unix.Uname(&utsname)
|
|
|
|
return string(utsname.Machine[:bytes.IndexByte(utsname.Machine[:], 0)]), err
|
|
|
|
}
|