KVM_NLIST(3K)

NAME
kvm_nlist - get entries from kernel symbol table

SYNOPSIS

#include <kvm.h>
#include <nlist.h>

int kvm_nlist(kd, nl)
kvm_t *kd;
struct nlist *nl;

DESCRIPTION

kvm_nlist() examines the symbol table from the kernel image identified by kd (see kvm_open(3K)) and selectively extracts a list of values and puts them in the array of nlist() structures pointed to by nl. The name list pointed to by nl() consists of an array of structures containing names, types and values. The n_name field of each such structure is taken to be a pointer to a character string representing a symbol name. The list is terminated by an entry with a NULL pointer (or a pointer to a null string) in the n_name field. For each entry in nl, if the named symbol is present in the kernel symbol table, its value and type are placed in the n_value and n_type fields. If a symbol cannot be located, the corresponding n_type field of nl() is set to zero.

RETURN VALUES

On success, kvm_nlist() returns the number of symbols that were not located in the symbol table. On failure, it returns -1 and sets all of the n_type fields in members of the array pointed to by nl to zero.

SEE ALSO
kvm_open(3K), kvm_read(3K), nlist(3V), a.out(5)