I'm trying to read /proc/<pid>/psinfo on SunOS systems. On linux these
files are all clear text, on sunos apparently not. So I probably have to
read them into struct psinfo_t from <sys/procfs.h>, but how do I do that?
I don't seem to find a standard call from a lib. Do I read the vars in
psinfo_t one by one, until I find the one I need? Do I need scanf()? (if
so how?)
TIA!
Paul Lemmens Use the Force Paul.L...@student.kun.nl
Mobile: Read the Source www.student.kun.nl/paul.lemmens
"Fate, it seems, is not without a sense of irony" (Morpheus, The Matrix).
open the file.
allocate a psinfo_t struct.
read sizeof(psinfo_t) bytes into the struct.
deference the fields that you are interested in.
--
Steve Coleman <Steve....@jhuapl.edu> http://www.jhuapl.edu/
<<--------->> Johns Hopkins Applied Physics Laboratory <<---------->>
Balt:443-778-6330 Fax:443-778-5597 Wash:240-228-6330 Fax:240-228-5597
Try to get qps source from Solaris site. That contains the info you required.
Regards
Sudheer
Paul Lemmens wrote:
> Hello everybody,
>
> I'm trying to read /proc/<pid>/psinfo on SunOS systems. On linux these
> files are all clear text, on sunos apparently not. So I probably have to
> read them into struct psinfo_t from <sys/procfs.h>, but how do I do that?
> I don't seem to find a standard call from a lib. Do I read the vars in
> psinfo_t one by one, until I find the one I need? Do I need scanf()? (if
> so how?)
>