Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!orstcs!mist!johnsot From: johnsot@mist.CS.ORST.EDU (Tim G. Johnson) Newsgroups: comp.sys.next Subject: Re: nlist initialization? Message-ID: <10985@orstcs.CS.ORST.EDU> Date: 6 Jun 89 04:22:59 GMT References: <1499@uw-entropy.ms.washington.edu> Sender: usenet@orstcs.CS.ORST.EDU Reply-To: johnsot@mist.CS.ORST.EDU (Tim G. Johnson) Distribution: usa Organization: Oregon State University -- Computer Science Lines: 28 In article <1499@uw-entropy.ms.washington.edu> hubert@cac.washington.edu (Steve Hubert) writes: > >I presume that the Mach nlist format is preventing this from working. >The error I get (twice) is "type mismatch in initialization," with a line >number pointing to the closing brace of the initialization. I tried it >with the -bsd flag and it doesn't change. Since the name in the nlist specification in nlist.h now resides within a union within the struct, you need to add an extra set of brackets around the name declarations: struct nlist Nl[] = { { { "_avenrun" } }, #define X_AVENRUN 0 { { "" } } } I used this declaration to try to get the load average on the NeXT. I was able to nlist into /vmunix (/mach) to get the proper offset in Nl.value, but when I did a lseek into /dev/kmem, I never got the load average. If you figure actually get a valid reading, let me know. Thanks. (BTW, try looking up _mach_factor too. I dunno what it is really, though. /usr/ucb/w will show the mach factor with the -m flag.) Tim G. Johnson Computer Science Dept. johnsot@CS.ORST.EDU 308 Weatherford Hall Oregon State University hplabs!hp-pcd!orstcs!johnsot Corvallis, OR 97331 Corvallis, OR 97331 tektronix!orstcs!johnsot (503) 758-9639 (503) 754-3273 johnsot@oregon-state.BITNET