--- kvm.c.orig Sun Jun 25 00:32:22 2006 +++ kvm.c Sun Jun 25 00:34:40 2006 @@ -307,7 +307,9 @@ struct nlist *p; int nvalid; struct kld_sym_lookup lookup; + int error; + error = 0; /* * If we can't use the kld symbol lookup, revert to the * slow library call. @@ -339,9 +341,13 @@ } } /* - * Return the number of entries that weren't found. + * Return the number of entries that weren't found. If they exist, + * also fill internal error buffer. */ - return ((p - nl) - nvalid); + error = ((p - nl) - nvalid); + if (error) + _kvm_syserr(kd, kd->program, "kvm_nlist"); + return (error); } ssize_t