qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user: added fake open() for /proc/self/cmdline
@ 2014-06-17  3:16 lists
  2014-06-17  3:16 ` lists
  0 siblings, 1 reply; 6+ messages in thread
From: lists @ 2014-06-17  3:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee



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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-06-20 12:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-17  3:16 [Qemu-devel] [PATCH] linux-user: added fake open() for /proc/self/cmdline lists
2014-06-17  3:16 ` lists
2014-06-17 21:09   ` Eric Blake
2014-06-18  9:02     ` lists
2014-06-18  9:02       ` lists
2014-06-20 12:37         ` Riku Voipio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).