Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!samsung!uunet!brunix!cgy From: cgy@cs.brown.edu (Curtis Yarvin) Newsgroups: comp.unix.wizards Subject: Re: Writing portable code that reads /dev/kmem Keywords: oxymoron Message-ID: <76560@brunix.UUCP> Date: 23 May 91 14:20:56 GMT References: Sender: news@brunix.UUCP Reply-To: cgy@cs.brown.edu (Curtis Yarvin) Organization: Brown University Department of Computer Science Lines: 29 In article Bjorn.Larsen@usit.uio.no writes: > >We are writing a daemon that should execute on a number of different >UNIX platforms. It should fetch performance information about the >running system. > >We want to make this program as portable as possible, possibly by >dividing it into one generic part and one system-specific part. > >The UNIX variants that we want to run this daemon on includes SunOS, >Ultrix, OSF/1, SVR4, SVR3.2, Convex UNIX, SCO UNIX, and possibly >others. Yow. >I'm looking for advice on the best way to handle this. Does there >exist a standard interface for retreiving such information? >I've heard rumors that there exists a kmem-access library for BSD4.3. It should never have had to exist in the first place; but there is. -lkvm will link with it. But it needs a symbol to find. It can read the data corresponding to a kernel name or a kernel virtual address. But bear in mind that when we say "symbol," we're talking about internal kernel variables. This stuff is by definition unportable. Your best bet is to make a very explicit split between the portable and nonportable modules of the monitor daemon. Curtis