Forum Topic - path of new process: (2 Items)
   
path of new process  
Hello,

I am trying to get the process id of a process from its name.
I use the linux way of looking into the procfs and looking for the path:
/proc/$pid/ processname..

But I dont see this path at all.. there is only an 'as' and I read the 'Processes' docs in the Momentics IDE but dint 
understand. Tried even looking into the pidin code but got confused.

Can somebody help me.

Bottomline is: I have to write a C code to kill all process instantiated under a name.
I thought of getting the pid of all process under this name using the readlink(path) /proc/pid directory and doing a 
string compare for the process name.

And once I get the pid I do a kill(pid,SIGTERM).

How do I go about it?

By the way where is the process path? The proc directory isnt like the linux procfs....


Thank you
AW: path of new process  
you have to use devctl() on procfs and iterate over the entries you find in /proc
take a look at slay source, found in utils/s/slay
http://community.qnx.com/integration/viewvc/viewvc.cgi/trunk/utils/s/slay/?root=coreos_pub&system=exsy1001


HTH
/hp

>-----Ursprüngliche Nachricht
-----
>Von: Patrick Immling [mailto:community-noreply@qnx.com] 
>Gesendet: Freitag, 19. März 2010 08:06
>An: general-filesystems
>Betreff: path of new process
>
>Hello,
>
>I am trying to get the process id of a process from its name.
>I use the linux way of looking into the procfs and looking for 
>the path:
>/proc/$pid/ processname..
>
>But I dont see this path at all.. there is only an 'as' and I 
>read the 'Processes' docs in the Momentics IDE but dint 
>understand. Tried even looking into the pidin code but got confused.
>
>Can somebody help me.
>
>Bottomline is: I have to write a C code to kill all process 
>instantiated under a name.
>I thought of getting the pid of all process under this name 
>using the readlink(path) /proc/pid directory and doing a 
>string compare for the process name.
>
>And once I get the pid I do a kill(pid,SIGTERM).
>
>How do I go about it?
>
>By the way where is the process path? The proc directory isnt 
>like the linux procfs....
>
>
>Thank you
>
>
>
>_______________________________________________
>
>General
>http://community.qnx.com/sf/go/post49982
>
>