Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Reading /proc/<PID>/psinfo on solaris

862 views
Skip to first unread message

Paul Lemmens

unread,
Sep 20, 1999, 3:00:00 AM9/20/99
to
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?)

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


Steve Coleman

unread,
Sep 21, 1999, 3:00:00 AM9/21/99
to Paul Lemmens
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?)

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

Sudheer Kurichiyath

unread,
Oct 11, 1999, 3:00:00 AM10/11/99
to
Hi Paul,

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?)
>

0 new messages