1837930 Members
2889 Online
110124 Solutions
New Discussion

Process-Id Discovery

 
Sunderjeet Singh
Occasional Contributor

Process-Id Discovery

Hi,

What are possible options of process-id discovery in HP-UX 11i (except ps)? I want to discover the process-ids of some set of processes in the system from within a C program. Does HP-UX has something similar to Linux /proc filesystem.

thanks
-Sunderjs
3 REPLIES 3
Peter Godron
Honored Contributor

Re: Process-Id Discovery

Hi,
and welcome to the forums !

Please see this earlier thtread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1074999

Please read:
http://66.34.90.71/ITRCForumsEtiquette/after.html

Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.
Senthil Prabu.S_1
Trusted Contributor

Re: Process-Id Discovery

Hi,
You can use the lsof tool to find the opened file on the system by any processes.

U can download the depot from;
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.77/


HTH,
Prabu.S
One man's "magic" is another man's engineering. "Supernatural" is a null word.
Ralph Grothe
Honored Contributor

Re: Process-Id Discovery

Unfortunately, HP-UX doesn't come with a /proc virtual filesystem.
I also haven't heard of a patch that would supply this feature.
If you want to access process data programatically you could use the pstat() syscall.
In man 2 pstat the struct is explained, and there's even an example code snippet.
Madness, thy name is system administration