Path: utzoo!utgpu!attcan!uunet!husc6!bloom-beacon!gatech!dcatla!holos0!fsg From: fsg@holos0.UUCP (Frank Glass) Newsgroups: comp.unix.wizards Subject: finding the u structure in /dev/mem on SYSV (how ?) Message-ID: <1240@holos0.UUCP> Date: 4 Aug 88 18:06:40 GMT Reply-To: fsg@holos0.UUCP (Frank Glass) Distribution: na Organization: Holos Software, Atlanta Lines: 20 I am writing a routine to list UNIX processes and their respective ages. I need for the source to be reasonably portable across System V (or at least USG) breeds of machines. Getting to the proc table seems simple and consistent: use nl() to get proc address from /unix, seek to that address in /dev/kmem and read the first element in. Any macros I need seem to be in sys/sysmacros.h. The next problem is getting to the u structure in /dev/mem. (I have no problem finding u structures of swapped processes in /dev/swap). I can't seem to find a _consistent_ macro to relate the pointer or click number in the proc structure to the offset into /dev/mem. I am using AT&T 3b2, NCR Tower 32 and a Xenix 286 machine. I have solved the problem on two of the three, but there seems not to be a common solution and I have many machines to go. Any email help here will be much appreciated. My CORRECT uucp routing: ...!gatech!holos0!fsg -- Frank Glass Holos Software, Inc. Voice: (404) 496-1358 UUCP: ...!gatech!holos0!fsg