From d088d664f2015ba9d168e61d56c599cee81f2aad Mon Sep 17 00:00:00 2001 From: aurel32 Date: Fri, 30 Jan 2009 20:09:01 +0000 Subject: linux-user: identify running binary in /proc/self/exe Some applications like to test /proc/self/exe to find out who they are. Fake the result of readlink() for them. Use realpath() to return full path to binary (which the links /proc/self/exe are) Signed-off-by: Riku Voipio Signed-off-by: Aurelien Jarno git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6485 c046a42c-6fe2-441c-8c8c-71466251a162 --- linux-user/main.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'linux-user/main.c') diff --git a/linux-user/main.c b/linux-user/main.c index 284112043..95efe398c 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -37,6 +37,8 @@ #define DEBUG_LOGFILE "/tmp/qemu.log" +char *exec_path; + static const char *interp_prefix = CONFIG_QEMU_PREFIX; const char *qemu_uname_release = CONFIG_UNAME_RELEASE; @@ -2341,6 +2343,7 @@ int main(int argc, char **argv, char **envp) if (optind >= argc) usage(); filename = argv[optind]; + exec_path = argv[optind]; /* Zero out regs */ memset(regs, 0, sizeof(struct target_pt_regs)); -- cgit v1.2.3