pstat & Linux

Yuri Ermakov

pstat & Linux


I need a function like hp-ux pstat interface pstat_getproc

OS Red Hat Enterpise Linux 3 AS

Best wishes
Yuri Ermakov
Vitaly Karasik_1
Honored Contributor

Re: pstat & Linux

this doc (Linux Porting Guide) from HP may help.

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:
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.)