C code to have CPU and RAM USAGE (pct) of a given process

From: lombardi emanuele <lele_at_mantegna.casaccia.enea.it>
Date: Tue, 24 Nov 1998 10:51:05 +0100 (MET)

Dear system managers,

Dunix 4.0d

I' m looking for a piece of code which , given a Process Id, can print
the percentage of the CPUs and of the RAM the process is using.
I need the some value given by
ps aux
but I would like to do it by C not by shell.

Any suggestion ?

Thanks from Italy,
Emanuele

-- 
 Emanuele Lombardi
 mail:  AMB-GEM-CLIM ENEA Casaccia
        I-00060 S.M. di Galeria (RM)  ITALY
 mailto:lele_at_mantegna.casaccia.enea.it
 tel	+39 6 30483366 fax	+39 6 30483591
     This transmission was made possible by 100% recycled electrons.
Received on Tue Nov 24 1998 - 09:53:48 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:38 NZDT