diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 2eac6d5..54c3a3a 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5222,6 +5222,13 @@ static int do_open(void *cpu_env, const char *pathname, int flags, mode_t mode) { NULL, NULL, NULL } }; + CPUState *cpu = ENV_GET_CPU((CPUArchState *)cpu_env); + TaskState *ts = cpu->opaque; + + if (is_proc_myself(pathname, "exe")) { + return get_errno(open(path(ts->bprm->argv[0]), flags, mode)); + } + for (fake_open = fakes; fake_open->filename; fake_open++) { if (fake_open->cmp(pathname, fake_open->filename)) { break;