mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 6/9] UML - UML/i386 is i386 when running on x86_64
@ 2005-08-29 20:07 Jeff Dike
  0 siblings, 0 replies; only message in thread
From: Jeff Dike @ 2005-08-29 20:07 UTC (permalink / raw)
  To: akpm
  Cc: linux-kernel, user-mode-linux-devel,
	Paolo 'Blaisorblade' Giarrusso

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

Signed-off-by: Jeff Dike <jdike@addtoit.com>

Index: linux-2.6.12-rc6/arch/um/kernel/user_util.c
===================================================================
--- linux-2.6.12-rc6.orig/arch/um/kernel/user_util.c	2005-08-08 12:32:06.000000000 -0400
+++ linux-2.6.12-rc6/arch/um/kernel/user_util.c	2005-08-12 14:00:34.000000000 -0400
@@ -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];


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-08-29 20:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-29 20:07 [PATCH 6/9] UML - UML/i386 is i386 when running on x86_64 Jeff Dike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®