diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-05-14 11:30:38 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-05-14 11:30:38 +0000 |
commit | c59372208a928828dd7d1cceaee78b48e5e03611 (patch) | |
tree | 0745c1578da58eec8621dc2bb6f156fbc093fe7d /linux-user | |
parent | 00a9bf191b9353e1bd981539c25821bf6a81e00f (diff) | |
download | qemu-c59372208a928828dd7d1cceaee78b48e5e03611.tar.gz qemu-c59372208a928828dd7d1cceaee78b48e5e03611.tar.bz2 qemu-c59372208a928828dd7d1cceaee78b48e5e03611.zip |
Teach usermode emulation how to lie about uname -r.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1920 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/main.c | 3 | ||||
-rw-r--r-- | linux-user/qemu.h | 1 | ||||
-rw-r--r-- | linux-user/syscall.c | 3 |
3 files changed, 7 insertions, 0 deletions
diff --git a/linux-user/main.c b/linux-user/main.c index 78f45a5f9f..23e9e85b10 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -34,6 +34,7 @@ #endif static const char *interp_prefix = CONFIG_QEMU_PREFIX; +const char *qemu_uname_release = CONFIG_UNAME_RELEASE; #if defined(__i386__) && !defined(CONFIG_STATIC) /* Force usage of an ELF interpreter even if it is an ELF shared @@ -1514,6 +1515,8 @@ int main(int argc, char **argv) } } else if (!strcmp(r, "g")) { gdbstub_port = atoi(argv[optind++]); + } else if (!strcmp(r, "r")) { + qemu_uname_release = argv[optind++]; } else #ifdef USE_CODE_COPY if (!strcmp(r, "no-code-copy")) { diff --git a/linux-user/qemu.h b/linux-user/qemu.h index a797c512bb..7c7bcf34e6 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -80,6 +80,7 @@ typedef struct TaskState { } __attribute__((aligned(16))) TaskState; extern TaskState *first_task_state; +extern const char *qemu_uname_release; int elf_exec(const char * filename, char ** argv, char ** envp, struct target_pt_regs * regs, struct image_info *infop); diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 7da469aa89..4afc6d888c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2861,6 +2861,9 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, /* Overrite the native machine name with whatever is being emulated. */ strcpy (buf->machine, UNAME_MACHINE); + /* Allow the user to override the reported release. */ + if (qemu_uname_release && *qemu_uname_release) + strcpy (buf->release, qemu_uname_release); } unlock_user_struct(buf, arg1, 1); } |