Date: Mon, 15 Jun 2020 20:12:11 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362205 - head/sys/compat/linux Message-ID: <202006152012.05FKCBNU054075@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Mon Jun 15 20:12:10 2020 New Revision: 362205 URL: https://svnweb.freebsd.org/changeset/base/362205 Log: Make Linux uname(2) return x86_64 to 32-bit apps. This helps Steam. PR: kern/240432 Analyzed by by: Alex S <iwtcex@gmail.com> Reviewed by: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25248 Modified: head/sys/compat/linux/linux_misc.c Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Mon Jun 15 19:46:34 2020 (r362204) +++ head/sys/compat/linux/linux_misc.c Mon Jun 15 20:12:10 2020 (r362205) @@ -704,7 +704,17 @@ linux_newuname(struct thread *td, struct linux_newunam *p = '\0'; break; } +#if defined(__amd64__) + /* + * On amd64, Linux uname(2) needs to return "x86_64" + * for both 64-bit and 32-bit applications. On 32-bit, + * the string returned by getauxval(AT_PLATFORM) needs + * to remain "i686", though. + */ + strlcpy(utsname.machine, "x86_64", LINUX_MAX_UTSNAME); +#else strlcpy(utsname.machine, linux_kplatform, LINUX_MAX_UTSNAME); +#endif return (copyout(&utsname, args->buf, sizeof(utsname))); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006152012.05FKCBNU054075>