Fix Linux compat 'uname -m' on AMD64.

Submitted by:	Jung-uk Kim <jkim@niksun.com>
		(patch reworked by me)
This commit is contained in:
obrien 2005-01-14 03:45:26 +00:00
parent 17c8f614b7
commit 98c3a8a894

View File

@ -763,9 +763,15 @@ linux_newuname(struct thread *td, struct linux_newuname_args *args)
}
strlcpy(utsname.machine, class, LINUX_MAX_UTSNAME);
}
#elif defined(__amd64__) /* XXX: Linux can change 'personality'. */
#ifdef COMPAT_LINUX32
strlcpy(utsname.machine, "i686", LINUX_MAX_UTSNAME);
#else
strlcpy(utsname.machine, "x86_64", LINUX_MAX_UTSNAME);
#endif /* COMPAT_LINUX32 */
#else /* something other than i386 or amd64 - assume we and Linux agree */
strlcpy(utsname.machine, machine, LINUX_MAX_UTSNAME);
#endif
#endif /* __i386__ */
strlcpy(utsname.domainname, domainname, LINUX_MAX_UTSNAME);
return (copyout(&utsname, args->buf, sizeof(utsname)));