You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gopsutil/host/host_posix.go

16 lines
344 B
Go

// SPDX-License-Identifier: BSD-3-Clause
//go:build linux || freebsd || openbsd || netbsd || darwin || solaris
package host
import "golang.org/x/sys/unix"
func KernelArch() (string, error) {
var utsname unix.Utsname
err := unix.Uname(&utsname)
if err != nil {
return "", err
}
return unix.ByteSliceToString(utsname.Machine[:]), nil
}