mirror of https://github.com/shirou/gopsutil
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
342 B
Go
12 lines
342 B
Go
// SPDX-License-Identifier: BSD-3-Clause
|
|
package common
|
|
|
|
import "unsafe"
|
|
|
|
// IsLittleEndian checks if the current platform uses little-endian.
|
|
// copied from https://github.com/ntrrg/ntgo/blob/v0.8.0/runtime/infrastructure.go#L16 (MIT License)
|
|
func IsLittleEndian() bool {
|
|
var x int16 = 0x0011
|
|
return *(*byte)(unsafe.Pointer(&x)) == 0x11
|
|
}
|