fix: utsname needs to distinguish between arm and non-arm

This commit is contained in:
mzz2017
2023-03-08 16:52:32 +08:00
parent 1b5ef8a192
commit d0d731375a
3 changed files with 36 additions and 10 deletions

View File

@ -90,16 +90,6 @@ func (v Version) Kernel() uint32 {
return uint32(uint8(v[0]))<<16 | uint32(uint8(v[1]))<<8 | uint32(uint8(s))
}
// utsnameToString converts the utsname to a string and returns it.
func utsnameToString(unameArray [65]int8) string {
var byteString [65]byte
var indexLength int
for ; unameArray[indexLength] != 0; indexLength++ {
byteString[indexLength] = uint8(unameArray[indexLength])
}
return string(byteString[:indexLength])
}
// KernelVersion returns the version of the currently running kernel.
func KernelVersion() (Version, error) {
kernelVersion.once.Do(func() {