Does anyone known how to specify the name of a child process that is created using the fork() function?
I want to be able to fork() 4 times and have each process have a different name to make debugging easier and also so that users can kill the processes by name if a problem occurs.
I have just found this page (http://www.uofr.net/~greg/processname.html) which would work but is a bit nasty as it depends on the length of the original parent's name. And also it only changes the commandline string not the actual process name.
My aim is to have something nice in "top" output like...
parent00
fork00_01
fork00_02
fork00_03
fork00_04
Currently all 5 of my processes have the same name and its impossible to tell them apart except by their process IDs, which isn't ideal.
Any ideas?




Reply With Quote