kvm_kerndisp(3)

kvm_kerndisp3

Get kernel displacement

Usage

#include <kvm.h>

kssize_t

kvm_kerndisp(kvm_t *kd);

Library

Kernel Data Access Library (libkvm, -lkvm)

Overview

kvm_kerndisp() returns the number of bytes by which the kernel referenced by kd is displaced. This is the difference between the kernel's base virtual address at run time and the kernel base virtual address specified in the kernel image file.

Note that if the kernel is moved to a lower memory address, the displacement will be negative.

Return values

kvm_kerndisp() returns the number of bytes by which the kernel is displaced. If the kernel is not displaced or if it is not possible to find the displacement then 0 is returned.

Releases

15 releases since FreeBSD 13.0-RELEASE; the text changed 1 time.

  1. 13.0–13.2
  2. 13.3–16.0

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.