Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!decwrl!sgi!jmb@patton.SGI.COM From: jmb@patton.SGI.COM (Jim Barton) Newsgroups: comp.sys.sgi Subject: Re: More Iris questions Keywords: NeWS, PostScript, Bells, Sounds, Load Average, Mail Biff Message-ID: <27442@sgi.SGI.COM> Date: 24 Feb 89 16:56:54 GMT References: <4337@pt.cs.cmu.edu> Sender: daemon@sgi.SGI.COM Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 33 In article <4337@pt.cs.cmu.edu>, gleicher@b.gp.cs.cmu.edu (Michael Gleicher) writes: ... (questions I can't answer skipped ...) ... > 4) The "gr_osview" program displays statistics like %cpu idle, %memory free, > %time waiting. Is there a way I can get at these numbers from a > C program so I can display them in a more convenient fashion? > "gr_osview" uses the standard System V structure sysinfo, which is "documented" in the header file /usr/include/sys/sysinfo.h. The structure can be conviently read using the sysmp(2) call, which has a man page, and uses the /usr/include/sys/sysmp.h header file. This avoids having to read the UNIX namelist and read from /dev/kmem, like standard SysV does. There are other interesting hooks in sysmp(2), some of which gr_osview uses. ... > -- > Michael Lee Gleicher gleicher@cs.cmu.edu > Computer Graphics & Animation, School of Computer Science > Carnegie Mellon University, Pittsburgh, PA 15213-3890 > -- -- Jim Barton Silicon Graphics Computer Systems "UNIX: Live Free Or Die!" jmb@sgi.sgi.com, sgi!jmb@decwrl.dec.com, ...{decwrl,sun}!sgi!jmb "I used to be disgusted, now I'm just amused." - Elvis Costello, 'Red Shoes' --