in reply to Re^4: assigning a name to every threads
in thread assigning a name to every threads
There's a reason I said Linux... :)
The problem is that setting $0 is not implemented for Solaris, at least not in a way that would work. AFAIK, that's because (a) there is no system support for it (in the form of setproctitle(), etc.), so you'd have to resort to manipulating argv[] directly at the C level, and (b) the normal tools like ps (i.e. /usr/bin/ps) or ptree don't read the command+args from argv[] anyway, but rather from some other, harder to manipulate location, so you'd have to use /usr/ucb/ps (whose output can - to some degree - be influenced by a modified argv[]).
In case I have the time later, I'll see whether I can whip up a little XS routine which would allow to change the command name as it's shown by /usr/ucb/ps...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: assigning a name to every threads
by ajeet@perl (Acolyte) on May 03, 2010 at 08:15 UTC | |
|
Re^6: assigning a name to every threads
by Anonymous Monk on May 03, 2010 at 09:09 UTC | |
by almut (Canon) on May 03, 2010 at 13:18 UTC |