changing ps output for processes (threads too?)

Andy Lo A Foe (arloafoe@cs.vu.nl)
Tue, 17 Nov 1998 02:17:48 +0100


Hi Peter,

> 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;
> }
>

Correct :)

But... does it work in a multithreaded application? AFAIK threads share the enviroment variables so
naming threads with this method is not going to work, unless the enviroment is also cloned. I'm
working on a threaded application and what I'd really like is to put some descriptive name on each
thread like "this is the decoder thread" and so on. Is this solvable in Linux right now?

Thanks,

Andy

--
Andy Lo A Foe, arloafoe@cs.vu.nl |  Linux v2.1.128  | PII 266
http://www.cs.vu.nl/~arloafoe    | GSM: 0622-440695 | Bebox 133
http://orbital.xs4all.nl/andy    |   ICQ: 7472949   | IRCNet: Adnans

- 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/