Re: changing ps output for processes (threads too?)

Tigran Aivazian (tigran@aivazian.demon.co.uk)
Tue, 17 Nov 1998 11:46:25 +0000 (GMT)


Hello guys,

You do realize, of course, that doing strcpy(argv[0], "bla-bla") can corrupt
/proc/<pid>/environ while retaining the correct /proc/<pid>/cmdline?

Regards,
Tigran

On Tue, 17 Nov 1998, Andy Lo A Foe wrote:
...
> > It doesn't seem to need access to /dev/kmem here :-) (this is a very
> > simplified version of the code from sendmail) ...
> >
> > #include <unistd.h>
> > #include <string.h>
> >
> > int main(int argc, char* argv[])
> > {
> > strcpy(argv[0], "this is a reasonably long string");
> >
> > if(!fork())
> > {
> > sleep(30);
> > }
> >
> > return 0;
> > }
...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/