> I'm trying to port a program to AIX which relies on getting very
> CPU usage time from another process (it's a profiler). It's currently
> running on a Solaris box, and we've been using the /proc filesystem
> to get the times needed (with a PIOCUSAGE ioctl).
> The box we're trying to port it to runs AIX 4.1, and does not have a
> /proc filesystem. Can someone suggest an equivalent way of getting the
> timing information?
> Thank you very much,
> Drew Bernat __
Take a gander at the getprocs() subroutine. It is the routine to access
the process table in AIX (must be root to access all processes,
otherwise you only get access to your own). It reads each process into
a structure called procsinfo (procinfo.h) which contains the user
(pi_ru.ru_utime) and system (pi_ru.ru_stime) times that you are looking
For more info, man getprocs.
Sometimes I sit and think...sometimes I just sit.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.