Re: get command from pid in gtk programm



rachit goel wrote:
hi all

i am facing a problem i need to know what command fired the process
with the given pid just like CMD ooption of ps command. But the issue
is that due to timing constraint i don't have enough time to
everytime fire a shell which writes this cmd from ps to a file and
read it . i need to be able to get it in my program .

i can get the pid by using libwnck library which is working just
fine.

any ideas how can i get this in my program .

thanks in advance.


Hello,

if I unterstood your problem right, you have a pid and want to know the name/cmd of this process?
You could read /proc/<your pid>/cmdline for this.


Hannes




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]