[RESOLVED] Changing the process name.
I want to fork my app into 4 processes and have a unique name for each one that shows up in `top`. Currently, top shows the same process name for each process (eg the name inherited from the parent process) which makes life difficult when trying to kill a specific process.
Is this even possible? I'm already using the argv[0] trick to change the command line for the forked processes but this doesn't show up in `top`.
I'm coding in C under Linux and Solaris by the way.
Re: Changing the process name.
You can use top with the -c option to view the entire command line instead of just the command name.
Also, if you run
It will give you a process tree and preserve command line arguments which can be useful for making sure you don't kill the parent :)
Re: Changing the process name.
Yeah that's what we were having to do previously.
Anyway, a colleague of mine found a nice undocumented feature and it seems to work...
http://www.vbforums.com/showthread.p...55#post3256555