PId from a process name

bridged with qnx.rtos
Post Reply
sabtain

PId from a process name

Post by sabtain » Fri Nov 16, 2007 9:30 pm

Is it possible to find out the pid of a process using process name?

maschoen

RE: PId from a process name

Post by maschoen » Sun Nov 18, 2007 1:56 am

Approximately

Colin Burgess

Re: PId from a process name

Post by Colin Burgess » Sun Nov 18, 2007 2:24 am

Take a look at the source to slay or pidin. Basically you will have to traverse

/proc/[0-9]*/as with readdir and then issue a DCMD_PROC_MAPDEBUG_BASE devctl on each
to fetch out the name.

sabtain wrote:
Is it possible to find out the pid of a process using process name?

--
cburgess@qnx.com

sabtain

Re: PId from a process name

Post by sabtain » Mon Nov 19, 2007 6:25 pm

I have the process names, I need PID


"Colin Burgess" <cburgess@qnx.com> wrote in message
news:fho7ht$rap$1@inn.qnx.com...
Take a look at the source to slay or pidin. Basically you will have to
traverse

/proc/[0-9]*/as with readdir and then issue a DCMD_PROC_MAPDEBUG_BASE
devctl on each
to fetch out the name.

sabtain wrote:
Is it possible to find out the pid of a process using process name?

--
cburgess@qnx.com

Colin Burgess

Re: PId from a process name

Post by Colin Burgess » Mon Nov 19, 2007 6:30 pm

Unfortunately you have to go through every pid, fetch it's name, and check to see if
it matches the name you already have. That is what slay and pidin do.

sabtain wrote:
I have the process names, I need PID


"Colin Burgess" <cburgess@qnx.com> wrote in message
news:fho7ht$rap$1@inn.qnx.com...
Take a look at the source to slay or pidin. Basically you will have to
traverse

/proc/[0-9]*/as with readdir and then issue a DCMD_PROC_MAPDEBUG_BASE
devctl on each
to fetch out the name.

sabtain wrote:
Is it possible to find out the pid of a process using process name?
--
cburgess@qnx.com

--
cburgess@qnx.com

Post Reply

Return to “qnx.rtos”