mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
069fdc8a08
Changes most references of syscall to golang.org/x/sys/
Ones aren't changes include, Errno, Signal and SysProcAttr
as they haven't been implemented in /x/sys/.
Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
[s390x] switch utsname from unsigned to signed
per 33267e036f
char in s390x in the /x/sys/unix package is now signed, so
change the buildtags
Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
18 lines
449 B
Go
18 lines
449 B
Go
// +build linux,386 linux,amd64 linux,arm64 s390x
|
|
// see golang's sources golang.org/x/sys/unix/ztypes_linux_*.go that use int8
|
|
|
|
package platform
|
|
|
|
// Convert the OS/ARCH-specific utsname.Machine to string
|
|
// given as an array of signed int8
|
|
func charsToString(ca [65]int8) string {
|
|
s := make([]byte, len(ca))
|
|
var lens int
|
|
for ; lens < len(ca); lens++ {
|
|
if ca[lens] == 0 {
|
|
break
|
|
}
|
|
s[lens] = uint8(ca[lens])
|
|
}
|
|
return string(s[0:lens])
|
|
}
|