1836432 Members
2553 Online
110100 Solutions
New Discussion

Re: pstat functions

 
Bhoyet Orillo
Occasional Contributor

pstat functions

good afternoon.

does anyone here know what can i replace all the pstat functions being used in my program because of i am trying to migrate my codes from HP-UX to Linux?

Thanks,
3 REPLIES 3
Elmar P. Kolkman
Honored Contributor

Re: pstat functions

You could try it by accessing /proc//status or the other 'files' there if you have /proc in your kernel...
Every problem has at least one solution. Only some solutions are harder to find.
Mark Grant
Honored Contributor

Re: pstat functions

I don't think there is an equivalent on Linux. This means you will have to find the relevant inormation from other system calls and asn Elmar suggest above, from the /proc filesystem.
Never preceed any demonstration with anything more predictive than "watch this"
Lethuillier
Frequent Advisor

Re: pstat functions

You can use "ps ax | wc -l" to get the process total, but I have not found yet a way to count total open files.

Another (dirty) answer is ;

echo `find /proc/[0-9]* -path '*/fd/*' | wc -l` / \
`cat /proc/sys/kernel/file-max`
Il faut avoir la foi et non les foies - Il faut avoir la forme et non les formes - Il faut faire la paix et non des pets