Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!paperboy!meissner From: meissner@osf.org (Michael Meissner) Newsgroups: comp.unix.internals Subject: Re: Displaying all processes info. Message-ID: Date: 10 Apr 91 22:00:17 GMT References: <7275@bgsuvax.UUCP> <1991Apr8.003022.10287@en.ecn.purdue.edu> <176@bria.UUCP> Sender: news@OSF.ORG Organization: Open Software Foundation Lines: 27 In-reply-to: mike@bria.UUCP's message of 9 Apr 91 23:37:03 GMT In article <176@bria.UUCP> mike@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@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?