uname: switch machine to HW_MACHINE_ARCH
On powerpc64, powerpc64le and riscv64 some software wrongly assumes that it runs on powerpc or riscv (32-bit). Differential revision: https://reviews.freebsd.org/D35962 Approved by: alfredo, imp
This commit is contained in:
parent
0ef861e6f4
commit
83bf6ab568
@ -127,11 +127,11 @@ __xuname(int namesize, void *namebuf)
|
||||
}
|
||||
q += namesize;
|
||||
|
||||
if ((p = getenv("UNAME_m")))
|
||||
if ((p = getenv("UNAME_p")))
|
||||
strlcpy(q, p, namesize);
|
||||
else {
|
||||
mib[0] = CTL_HW;
|
||||
mib[1] = HW_MACHINE;
|
||||
mib[1] = HW_MACHINE_ARCH;
|
||||
len = namesize;
|
||||
oerrno = errno;
|
||||
if (sysctl(mib, 2, q, &len, NULL, 0) == -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user