Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!sdd.hp.com!uakari.primate.wisc.edu!aplcen!haven!decuac!shlump.nac.dec.com!shodha.dec.com!alan From: alan@shodha.dec.com ( Alan's Home for Wayward Notes File.) Newsgroups: comp.unix.ultrix Subject: Re: Retrieving per-process info on DS3100 Summary: They do it the hard way. Message-ID: <1429@shodha.dec.com> Date: 13 Jul 90 15:33:11 GMT References: <2371.269db532@csc.anu.oz> Organization: Digital Equipment Corp. - Colorado Springs, CO. Lines: 31 In article <2371.269db532@csc.anu.oz>, pjy100@csc.anu.oz writes: > Can anyone help ???? > > I wish to obtain information about every process currently on the system > from the two data structures "proc" and "user" (see /usr/include/sys/proc.h > & /usr/include/sys/user.h) from within a "c" program, but I cannot find a > system call that will retrieve this information from the system tables. > How can this be done? (pstat & ps must use the method I require). SunOS > provides the calls "kvm_nextproc" & "kvm_getu" for doing what I need, is there > an equivalent method for Ultrix 3.1 on a DS3100. Pstat, ps, top, monitor, etc all do it basically the way; open /dev/kmem, seek to an interesting place and read the data. Getting the proc structure is pretty easy. Getting a copy of the user structure is harder because you have to deal with the fact that it might swapped out. I'd suggest looking for a copy of top or monitor that you can copy and borrow from them. I think monitor can be found on gatekeeper.dec.com. If you think having a system call interface to some of these data structures would make your life so much easier please submit an SPR with the suggestion. If there is sufficient popular interest it might get added someday. > Peter Young (systems prog. Mt Stromlo Observatory) -- Alan Rollow alan@nabeth.enet.dec.com