1751894 Members
4796 Online
108783 Solutions
New Discussion юеВ

Re: pstat & Linux

 
Yuri Ermakov
Contributor

pstat & Linux

Hello!

I need a function like hp-ux pstat interface pstat_getproc

OS Red Hat Enterpise Linux 3 AS

Best wishes
Yuri Ermakov
Ermak
3 REPLIES 3
Vitaly Karasik_1
Honored Contributor

Re: pstat & Linux

this doc devrsrc1.external.hp.com/LPK/docs/portguideparisc.pdf (Linux Porting Guide) from HP may help.

Rgds,
Vitaly
Andrew Cowan
Honored Contributor

Re: pstat & Linux

A quick and dirty equivelant of some of its functions is:

echo `find /proc/[0-9]* -path '*/fd/*' | wc -l` / \
`cat /proc/sys/kernel/file-max`
You can also look in "/proc/sys/kernel/file-nr" and "inode-nr".

also try this script: http://madduck.net/~madduck/scratch/pstat
Stan Sieler
Respected Contributor

Re: pstat & Linux

The porting guide is for the OPPOSITE direction (i.e., it discusses Linux -> HP-UX,
not the requested HP-UX -> Linux).

The script is a **script**, and Yuri's looking for a function (e.g., compilable code, usually C).

And...yep...I've got the same problem,
and am looking for a solution. If I find
one, I'll try to post a note here :)

(I don't want to "roll my own" and write
code to read /proc//stat ... but that's
one way to do it.)


Yuri: are you interested in pstat_getproc
more for the "get info for a single PID"
or more for "get info for many/all PIDs"?
(I ask because that might affect the
possible answers.)