From: Paolo Giarrusso <blaisorblade@yahoo.it>

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>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 arch/um/kernel/user_util.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

diff -puN arch/um/kernel/user_util.c~uml-uml-i386-is-i386-when-running-on-x86_64 arch/um/kernel/user_util.c
--- devel/arch/um/kernel/user_util.c~uml-uml-i386-is-i386-when-running-on-x86_64	2005-08-30 00:11:19.000000000 -0700
+++ devel-akpm/arch/um/kernel/user_util.c	2005-08-30 00:11:19.000000000 -0700
@@ -132,7 +132,12 @@ void setup_machinename(char *machine_out
 	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];
_