KVM_NLIST(3)
okay bestie, welcome to the KVM_NLIST(3) page from the Library Functions Manual π β weβre retrieving symbol table names from a kernel image and itβs lowkey iconic.
β¨ NAME β¨
kvm_nlist, kvm_nlist2 β retrieve symbol table names from a kernel image. thatβs the whole vibe.
π LIBRARY π
Kernel Data Access Library (libkvm, -lkvm) β link it with -lkvm, bestie.
πΈ SYNOPSIS πΈ
#include <kvm.h>
#include <nlist.h>
int
kvm_nlist(kvm_t *kd, struct nlist *nl);
int
kvm_nlist2(kvm_t *kd, struct kvm_nlist *nl);
π DESCRIPTION π
kvm_nlist() retrieves the symbol table entries indicated by the name list argument nl. That argument points to an array of nlist structures, and the array is terminated by an entry whose n_name field is NULL (see nlist(3)). Each symbol gets looked up using the n_name field, and if itβs found, the corresponding n_type and n_value fields are filled in. If the symbol is not found, those fields are set to 0 β no cap.
The kldsym(2) system call is used to locate symbols in live kernels. This is a less than perfect emulation of the nlist values, but it has the advantage of being aware of kernel modules and is reasonably fast. honestly? slay.
kvm_nlist2() retrieves the symbol table entries indicated by the name list argument nl. This nl points to an array of struct kvm_nlist structures, terminated by an entry whose n_name field is NULL. These structures are similar to the nlist structures used by kvm_nlist(), except that the n_value field uses a different type (kvaddr_t) to avoid truncation when examining non-native kernel images. itβs giving cross-platform awareness π
π RETURN VALUES π
kvm_nlist() and kvm_nlist2() return the number of invalid entries found. If the kernel symbol table was unreadable, -1 is returned. thatβs your vibe check.
π SEE ALSO π
go look at these besties:
kldsym(2)kvm(3)kvm_close(3)kvm_getargv(3)kvm_getenvv(3)kvm_geterr(3)kvm_getprocs(3)kvm_native(3)kvm_open(3)kvm_openfiles(3)kvm_read(3)kvm_write(3)
π¦ HISTORY π¦
The kvm_nlist2() function first appeared in FreeBSD 11.0. periodt.
source/version: Debian; date: November 27, 2015; this page is KVM_NLIST(3) β byeee, bestie π«Άπ
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 1992, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms