From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WgIw8-000815-O1 for qemu-devel@nongnu.org; Fri, 02 May 2014 15:16:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WgIw4-00008d-L3 for qemu-devel@nongnu.org; Fri, 02 May 2014 15:15:56 -0400 Received: from afflict.kos.to ([92.243.29.197]:48054) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WgIw4-0008WL-Bt for qemu-devel@nongnu.org; Fri, 02 May 2014 15:15:52 -0400 From: riku.voipio@linaro.org Date: Fri, 2 May 2014 22:15:36 +0300 Message-Id: In-Reply-To: References: Subject: [Qemu-devel] [PULL 01/14] linux-user: Add /proc/self/exe open forwarding List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Maxim Ostapenko From: Maxim Ostapenko QEMU already supports /proc/self/{maps,stat,auxv} so addition of /proc/self/exe is rather trivial. Fixes https://bugs.launchpad.net/qemu/+bug/1299190 Signed-off-by: Maxim Ostapenko Reviewed-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/syscall.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 9864813..5203cc4 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -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; -- 2.0.0.rc0