From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwvve-00032t-EP for qemu-devel@nongnu.org; Tue, 17 Jun 2014 12:08:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwvvW-0005cv-Ve for qemu-devel@nongnu.org; Tue, 17 Jun 2014 12:08:10 -0400 Received: from mail-we0-f175.google.com ([74.125.82.175]:56424) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwvvW-0005cR-Ps for qemu-devel@nongnu.org; Tue, 17 Jun 2014 12:08:02 -0400 Received: by mail-we0-f175.google.com with SMTP id k48so6678430wev.20 for ; Tue, 17 Jun 2014 09:08:01 -0700 (PDT) Sender: Wim Vander Schelden From: lists@fixnum.org Date: Tue, 17 Jun 2014 05:16:58 +0200 Message-Id: <1402975019-19503-1-git-send-email-lists@fixnum.org> Subject: [Qemu-devel] [PATCH] linux-user: added fake open() for /proc/self/cmdline List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org A piece of software I use depends on /proc/self/cmdline to determine the command with which it was invoked. When using linux-user, that file would read: $ hd /proc/self/cmdline 00000000 2f 75 73 72 2f 62 69 6e 2f 71 65 6d 75 2d 61 72 |/usr/bin/qemu-ar| 00000010 6d 2d 73 74 61 74 69 63 00 2f 75 73 72 2f 62 69 |m-static./usr/bi| 00000020 6e 2f 68 64 00 2f 70 72 6f 63 2f 73 65 6c 66 2f |n/hd./proc/self/| 00000030 63 6d 64 6c 69 6e 65 00 |cmdline.| With this patch, the first word is omitted from the process's own cmdline entry, removing the emulator path from the file: $ hd /proc/self/cmdline 00000000 2f 75 73 72 2f 62 69 6e 2f 68 64 00 2f 70 72 6f |/usr/bin/hd./pro| 00000010 63 2f 73 65 6c 66 2f 63 6d 64 6c 69 6e 65 00 |c/self/cmdline.| 0000001f Kind regards, Wim