da6a98fac5b57ed6a6d4c12feda720657542e478
[unix-history] / usr / src / lib / libkvm / kvm_nlist.3
.\" Copyright (c) 1992 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" %sccs.include.redist.man%
.\"
.\" @(#)kvm_nlist.3 5.4 (Berkeley) %G%
.\"
.Dd
.Dt KVM_NLIST 3
.Os
.Sh NAME
.Nm kvm_nlist
.Nd retrieve symbol table names from a kernel image
.Sh SYNOPSIS
.Fd #include <kvm.h>
.Fd #include <nlist.h>
.Ft int
.Fn kvm_nlist "kvm_t *kd" "struct nlist *nl"
.Sh DESCRIPTION
.Fn kvm_nlist
retrieves the symbol table entries indicated by the name list argument
.Fa \&nl .
This argument points to an array of nlist structures, terminated by
an entry whose n_name field is
.Dv NULL
(see
.Xr nlist 3 ) .
Each symbol is looked up using the n_name field, and if found, the
corresponding n_type and n_value fields are filled in. These fields are set
to 0 if the symbol is not found.
.Pp
The program
.Xr kvm_mkdb 8
builds a database from the running kernel's namelist.
If the database matches the opened kernel,
.Fn kvm_nlist
uses it to speed lookups.
.Sh RETURN VALUES
The
.Fn kvm_nlist
function returns the number of invalid entries found.
If the kernel symbol table was unreadable, -1 is returned.
.Sh FILES
.Bl -tag -width /var/db/kvm_vmunix.db -compact
.It Pa /var/db/kvm_vmunix.db
.El
.Sh SEE ALSO
.Xr kvm 3 ,
.Xr kvm_close 3 ,
.Xr kvm_getargv 3 ,
.Xr kvm_getenvv 3 ,
.Xr kvm_geterr 3 ,
.Xr kvm_getprocs 3 ,
.Xr kvm_open 3 ,
.Xr kvm_openfiles 3 ,
.Xr kvm_read 3 ,
.Xr kvm_write 3 ,
.Xr kvm_mkdb 8