pkg/platform: replace use of deprecated syscall.Syscall

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-04-07 22:53:42 +02:00
parent 7ca38d64d2
commit 87019144f6
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -40,7 +40,7 @@ const (
// runtimeArchitecture gets the name of the current architecture (x86, x86_64, …)
func runtimeArchitecture() (string, error) {
var sysinfo systeminfo
syscall.Syscall(procGetSystemInfo.Addr(), 1, uintptr(unsafe.Pointer(&sysinfo)), 0, 0)
_, _, _ = syscall.SyscallN(procGetSystemInfo.Addr(), uintptr(unsafe.Pointer(&sysinfo)))
switch sysinfo.wProcessorArchitecture {
case ProcessorArchitecture64, ProcessorArchitectureIA64:
return "x86_64", nil
@ -58,6 +58,6 @@ func runtimeArchitecture() (string, error) {
// NumProcs returns the number of processors on the system
func NumProcs() uint32 {
var sysinfo systeminfo
syscall.Syscall(procGetSystemInfo.Addr(), 1, uintptr(unsafe.Pointer(&sysinfo)), 0, 0)
_, _, _ = syscall.SyscallN(procGetSystemInfo.Addr(), uintptr(unsafe.Pointer(&sysinfo)))
return sysinfo.dwNumberOfProcessors
}