xref: /original-bsd/lib/libkvm/kvm_nlist.3 (revision 2932bec8)
1.\" Copyright (c) 1992 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)kvm_nlist.3	5.4 (Berkeley) 04/29/92
7.\"
8.Dd
9.Dt KVM_NLIST 3
10.Os
11.Sh NAME
12.Nm kvm_nlist
13.Nd retrieve symbol table names from a kernel image
14.Sh SYNOPSIS
15.Fd #include <kvm.h>
16.Fd #include <nlist.h>
17.Ft int
18.Fn kvm_nlist "kvm_t *kd" "struct nlist *nl"
19.Sh DESCRIPTION
20.Fn kvm_nlist
21retrieves the symbol table entries indicated by the name list argument
22.Fa \&nl .
23This argument points to an array of nlist structures, terminated by
24an entry whose n_name field is
25.Dv NULL
26(see
27.Xr nlist 3 ) .
28Each symbol is looked up using the n_name field, and if found, the
29corresponding n_type and n_value fields are filled in.  These fields are set
30to 0 if the symbol is not found.
31.Pp
32The program
33.Xr kvm_mkdb 8
34builds a database from the running kernel's namelist.
35If the database matches the opened kernel,
36.Fn kvm_nlist
37uses it to speed lookups.
38.Sh RETURN VALUES
39The
40.Fn kvm_nlist
41function returns the number of invalid entries found.
42If the kernel symbol table was unreadable, -1 is returned.
43.Sh FILES
44.Bl -tag -width /var/db/kvm_vmunix.db -compact
45.It Pa /var/db/kvm_vmunix.db
46.El
47.Sh SEE ALSO
48.Xr kvm 3 ,
49.Xr kvm_close 3 ,
50.Xr kvm_getargv 3 ,
51.Xr kvm_getenvv 3 ,
52.Xr kvm_geterr 3 ,
53.Xr kvm_getprocs 3 ,
54.Xr kvm_open 3 ,
55.Xr kvm_openfiles 3 ,
56.Xr kvm_read 3 ,
57.Xr kvm_write 3 ,
58.Xr kvm_mkdb 8
59