KVM_NLIST(3)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

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:

πŸ¦‹ 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms