提交 aa07f5ec 编写于 作者: M Maxim Ostapenko 提交者: Riku Voipio

linux-user: Add /proc/self/exe open forwarding

QEMU already supports /proc/self/{maps,stat,auxv} so addition of
/proc/self/exe is rather trivial.

Fixes https://bugs.launchpad.net/qemu/+bug/1299190Signed-off-by: NMaxim Ostapenko <m.ostapenko@partner.samsung.com>
Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
上级 fdaad471
......@@ -5225,6 +5225,11 @@ static int do_open(void *cpu_env, const char *pathname, int flags, mode_t mode)
{ NULL, NULL, NULL }
};
if (is_proc_myself(pathname, "exe")) {
int execfd = qemu_getauxval(AT_EXECFD);
return execfd ? execfd : get_errno(open(exec_path, flags, mode));
}
for (fake_open = fakes; fake_open->filename; fake_open++) {
if (fake_open->cmp(pathname, fake_open->filename)) {
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册