This is the mail archive of the
mailing list for the Cygwin project.
Re: /proc/*/cmdline corrupted
Christopher Faylor-8 wrote:
> On Mon, Oct 17, 2011 at 10:27:18AM +0200, Corinna Vinschen wrote:
>>On Linux, /proc/$PID/cmdline always contains the full command line as
>>it has been when the process got started, irrespectively of changes
>>after process startup. It looks like the loader creates a copy of the
>>argv array before calling main.
> You can change the contents of what __argv[n] points to to modify what
> /proc/<pid>/cmdline displays though.
> strcpy (__argv, "a");
> That's pretty risky though.
>>Cygwin doesn't generate a copy of the argv array at startup, so the
>>processes __argv is the one used to call the main function. And I'm
>>reluctant to do that since it costs just more time for a process to
> Just creating a copy of argv without copying what it points to should be
> pretty inexpensive. It's too bad that we export __argv and __argc. I
> don't see Linux doing anything like that and it seems like a way for
> a Cygwin program to cause mischief.
> Problem reports: http://cygwin.com/problems.html
> FAQ: http://cygwin.com/faq/
> Documentation: http://cygwin.com/docs.html
> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
See the previous post about Linux:
And for the hell of possible solution see the link from that post:
View this message in context: http://old.nabble.com/-proc-*-cmdline-corrupted-tp32639066p32668296.html
Sent from the Cygwin list mailing list archive at Nabble.com.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple