Displaying all processes info.
Michael Meissner
meissner at osf.org
Thu Apr 11 08:00:17 AEST 1991
In article <176 at bria.UUCP> mike at bria.UUCP (Michael Stefanik) writes:
| In an article, en.ecn.purdue.edu!longshot (Longshot (tm)) writes:
| >I have done a little playing with this and had a few questions
| >myself... (1) Is there a good reference to help in programming with
| >references to special files like kmem? (2) How would one find the
| >list of all processes for a user by tty?
|
| The manual pages are woefully uninformative in respect to sloshing through
| /dev/kmem (and probably with good reason :-)
Yeah, stuff in there changes from OS revision to OS revision.
| Finding all of the processes for a user by tty would acutally not be that
| difficult; you would simply use nlist() to find the _proc symbol in the
| kernel, seek to the ``address'' given in /dev/kmem, and start reading, looking
| for the correct line.
Some systems have a system call to do this for you. For example,
OSF/1 supports table which gives you the proc table for the next n
processes. On System V.4, you should be able to just opendir /proc,
and zip through the processes that way.
--
Michael Meissner email: meissner at osf.org phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142
Considering the flames and intolerance, shouldn't USENET be spelled ABUSENET?
More information about the Comp.unix.internals
mailing list