How to get program name from running process

How to get program name from running process

Post by á¤á??? Chun-Mok Chun » Tue, 11 Apr 2000 04:00:00



I want to get the program name(pull path) of specific running process. As I
cannot get program name, I tried to get vnode pointer from u area of process
in kernel mode. I read "u.u_exdata.vp" variable, but it show only 0x0 value(I
tried on Solaris 2.5.1 at SPARCstation20). I did it according to the related
text book(Pate's UNIX Internals), but I could not. I want to know why it
doesn't work and other method to get program name or vnode pointer. Hope any
advice.

Thanks in advance,
Chun-Mok Chung.

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. Getting process name within a "C" program

Inside a "C" program is there any function call I can make that can
return
me the process name of a process.

For example take the output of the followin ps -ef command:

ps -ef | more
     UID   PID  PPID  C    STIME TTY      TIME CMD
    root     1     0  0   Jan 31 ?        7:08 /etc/init -

Inside my "C" program if have PID=1 how can I get the value "/etc/init
-". The information is obviously there since ps can display it.

If someone can point me in the right direction it would be very much
appreciated.

Thanks in advance for all who answer.

2. Y2k patch oss601a

3. Getting executable name of a running process

4. Vi is still broken.

5. How to get the program name of running process?

6. Routing a major network

7. Getting process name without using ps

8. Computer Security Master Class

9. getting process name

10. grep - getting the process name with awk (when it's over a day old)

11. getting process name w/o argv[0]

12. Getting Process Name

13. grep - getting the process name with awk (when it's over a day old)