Skip to content

Commit

Permalink
[PATCH] uml: fix uname under setarch i386
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paolo 'Blaisorblade' Giarrusso authored and Linus Torvalds committed Oct 11, 2006
1 parent 1b4ad24 commit 69fada3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion arch/um/os-Linux/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,18 @@ void setup_machinename(char *machine_out)
struct utsname host;

uname(&host);
#if defined(UML_CONFIG_UML_X86) && !defined(UML_CONFIG_64BIT)
#ifdef UML_CONFIG_UML_X86
# ifndef UML_CONFIG_64BIT
if (!strcmp(host.machine, "x86_64")) {
strcpy(machine_out, "i686");
return;
}
# else
if (!strcmp(host.machine, "i686")) {
strcpy(machine_out, "x86_64");
return;
}
# endif
#endif
strcpy(machine_out, host.machine);
}
Expand Down

0 comments on commit 69fada3

Please sign in to comment.