Skip to content

Commit 69fada3

Browse files
Paolo 'Blaisorblade' GiarrussoLinus Torvalds
authored andcommitted
[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>
1 parent 1b4ad24 commit 69fada3

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎arch/um/os-Linux/util.c‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,18 @@ void setup_machinename(char *machine_out)
8080
struct utsname host;
8181

8282
uname(&host);
83-
#if defined(UML_CONFIG_UML_X86) && !defined(UML_CONFIG_64BIT)
83+
#ifdef UML_CONFIG_UML_X86
84+
# ifndef UML_CONFIG_64BIT
8485
if (!strcmp(host.machine, "x86_64")) {
8586
strcpy(machine_out, "i686");
8687
return;
8788
}
89+
# else
90+
if (!strcmp(host.machine, "i686")) {
91+
strcpy(machine_out, "x86_64");
92+
return;
93+
}
94+
# endif
8895
#endif
8996
strcpy(machine_out, host.machine);
9097
}

0 commit comments

Comments
 (0)