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