From 98c3a8a894b937803df272ee68fb791709bc75d5 Mon Sep 17 00:00:00 2001 From: obrien Date: Fri, 14 Jan 2005 03:45:26 +0000 Subject: Fix Linux compat 'uname -m' on AMD64. Submitted by: Jung-uk Kim (patch reworked by me) --- sys/compat/linux/linux_misc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sys/compat/linux/linux_misc.c') diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index f17e0ad..6668841 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -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))); -- cgit v1.1