platform_unix.go 420 B

12345678910111213141516
  1. //go:build !windows
  2. package platform // import "github.com/docker/docker/pkg/platform"
  3. import (
  4. "golang.org/x/sys/unix"
  5. )
  6. // runtimeArchitecture gets the name of the current architecture (x86, x86_64, i86pc, sun4v, ...)
  7. func runtimeArchitecture() (string, error) {
  8. utsname := &unix.Utsname{}
  9. if err := unix.Uname(utsname); err != nil {
  10. return "", err
  11. }
  12. return unix.ByteSliceToString(utsname.Machine[:]), nil
  13. }