Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Aug 2020 12:54:20 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r364668 - stable/12/sys/compat/linux
Message-ID:  <202008241254.07OCsKXb041485@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Mon Aug 24 12:54:19 2020
New Revision: 364668
URL: https://svnweb.freebsd.org/changeset/base/364668

Log:
  MFC r362205:
  
  Make Linux uname(2) return x86_64 to 32-bit apps.  This helps Steam.
  
  PR:		kern/240432
  Analyzed by:	Alex S <iwtcex@gmail.com>
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/12/sys/compat/linux/linux_misc.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linux/linux_misc.c
==============================================================================
--- stable/12/sys/compat/linux/linux_misc.c	Mon Aug 24 12:51:20 2020	(r364667)
+++ stable/12/sys/compat/linux/linux_misc.c	Mon Aug 24 12:54:19 2020	(r364668)
@@ -776,7 +776,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?202008241254.07OCsKXb041485>