daemon/internal: adjust some build-tags

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-11-04 10:52:52 +01:00
parent bb27db85fb
commit 3a105f4e0c
3 changed files with 12 additions and 17 deletions

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -1,4 +1,4 @@
//go:build !windows
//go:build !darwin && !windows
// Package unix_noeintr provides wrappers for unix syscalls that retry on EINTR.
//