molu
1
Hi,
i need to find the process name using the process id in C. This has to be done in HP, AIX, Solaris & Linux??
How can this be done? Is there any common solution to all platforms?
On linux i have heard that /proc/<pid>/cmdline can be used. Is there a structure available to read this?
Please let me know.
Thanks,
molu
vino
2
See this post for more details - PS Command Field
There is an example provided in the external link in the above post. That should help you.
molu
3
Isnt there any struct available in linux that has the /proc info?
I found prpsinfo struct for SOlaris
molu
4
I have found solns for most platforms --
Solaris - read psinfo struc (refer proc man page)
AIX- Use getprocs() func
HP - Use pstat_getproc func.