aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>2006-10-11 04:21:36 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-11 14:14:20 -0400
commit69fada32d868d7f4be128ea4df8fbe4fd897fc34 (patch)
treeab216b52da48f39a418b1f67671c3fb05fce33df /arch/um
parent1b4ad242fcfcf1e261604cb91ee5fb8032900997 (diff)
[PATCH] uml: fix uname under setarch i386
On a 64bit Uml, if run under "setarch i386" (which a user did), uname() currently returns the obtained i686 as machine - fix that. Btw, I'm quite surprised that under setarch i386 a 64-bit binary can run. Cc: Andi Kleen <ak@suse.de> Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/os-Linux/util.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/um/os-Linux/util.c b/arch/um/os-Linux/util.c
index 3f5b1514e8a7..56b8a50e8bc2 100644
--- a/arch/um/os-Linux/util.c
+++ b/arch/um/os-Linux/util.c
@@ -80,11 +80,18 @@ void setup_machinename(char *machine_out)
80 struct utsname host; 80 struct utsname host;
81 81
82 uname(&host); 82 uname(&host);
83#if defined(UML_CONFIG_UML_X86) && !defined(UML_CONFIG_64BIT) 83#ifdef UML_CONFIG_UML_X86
84# ifndef UML_CONFIG_64BIT
84 if (!strcmp(host.machine, "x86_64")) { 85 if (!strcmp(host.machine, "x86_64")) {
85 strcpy(machine_out, "i686"); 86 strcpy(machine_out, "i686");
86 return; 87 return;
87 } 88 }
89# else
90 if (!strcmp(host.machine, "i686")) {
91 strcpy(machine_out, "x86_64");
92 return;
93 }
94# endif
88#endif 95#endif
89 strcpy(machine_out, host.machine); 96 strcpy(machine_out, host.machine);
90} 97}