mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
daemon/internal: adjust some build-tags
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// possibleCPUs returns the set of possible CPUs on the host (which is
|
||||
@@ -53,3 +55,12 @@ func parsePossibleCPUs(content string) []int {
|
||||
|
||||
return cpus
|
||||
}
|
||||
|
||||
// runtimeArchitecture gets the name of the current architecture (x86, x86_64, i86pc, sun4v, ...)
|
||||
func runtimeArchitecture() (string, error) {
|
||||
utsname := &unix.Utsname{}
|
||||
if err := unix.Uname(utsname); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return unix.ByteSliceToString(utsname.Machine[:]), nil
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
//go:build !windows
|
||||
|
||||
package platform
|
||||
|
||||
import (
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// runtimeArchitecture gets the name of the current architecture (x86, x86_64, i86pc, sun4v, ...)
|
||||
func runtimeArchitecture() (string, error) {
|
||||
utsname := &unix.Utsname{}
|
||||
if err := unix.Uname(utsname); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return unix.ByteSliceToString(utsname.Machine[:]), nil
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build !windows
|
||||
//go:build !darwin && !windows
|
||||
|
||||
// Package unix_noeintr provides wrappers for unix syscalls that retry on EINTR.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user