On Fri, 30 Mar 2001, Graham Wheeler wrote:

> Hi all
> 
> I had some code that worked on FreeBSD 3.4 to configure ISA devices.
> In order to get the ISA device settings, I used the kvm library, and
> started off by extracting the name lists for _isa_devtab_tty, 
> _isa_devtab_bio, and _isa_devtab_net.
> 
> I used to just give up if kvm_nlist returned a non-zero number. On
> FreeBSD 4.2 this is happening. Checking the manpage, I see that this
> could be that there are invalid values, so I changed the check to 
> only give up of the return value is negative. The code now gets past the
> kvm_nlist, but fails on the first kvm_read that follows (which uses the
> n_value returned by kvm_nlist as the offset field).
> 
> Is there a different mechanism in 4.2 to do the kind of stuff I'm 
> trying to do? Should the code still work?

libkvm is being gradually deprecated - you don't have to use it to do what
you want. Please take a look at the code in src/sbin/kget - it does
something very similar.

Andrzej

// ----------------------------------------------------------------
// Andrzej Bialecki <[EMAIL PROTECTED]>, Chief System Architect
// WebGiro AB, Sweden (http://www.webgiro.com)
// ----------------------------------------------------------------
// <[EMAIL PROTECTED]> FreeBSD developer (http://www.freebsd.org)



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to