Skip to contentSkip to conversation

UML - UML/i386 is i386 when running on x86_64

PATCH In review Jeff Dike 1 participant 1 message Aug 29, 2005 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 6/9 UML - UML/i386 is i386 when running on x86_64

From Paolo Giarrusso - Make a UML/i386 instance running on x86_64 pretend to be i386 rather than x86_64.

arch/um/kernel/user_util.c +6 -1
Index: linux-2.6.12-rc6/arch/um/kernel/user_util.c
===================================================================
@@ -132,7 +132,12 @@
 	struct utsname host;
 
 	uname(&host);
-	strcpy(machine_out, host.machine);
+	/* XXX: crude detection of 32-bit binary. */
+	if (sizeof(long) == 4 && !strcmp(host.machine, "x86_64")) {
+		strcpy(machine_out, "i686");
+	} else {
+		strcpy(machine_out, host.machine);
+	}
 }
 
 char host_info[(_UTSNAME_LENGTH + 1) * 4 + _UTSNAME_NODENAME_LENGTH + 1];

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel