KSYMS(4)
π KSYMS(4) β the kernel symbol table interface, bestie π
okay so real talk, this is the ksyms page from section 4 of the Kernel Interfaces Manual β that's the "kernel interfaces" girlies section, and honestly? she's giving quiet main character energy. let's get into it π¦
β¨ NAME β¨
ksyms β kernel symbol table interface π
πΈ SYNOPSIS πΈ
device ksyms
that's it. that's the whole vibe. one line. iconic. β¨
π DESCRIPTION π
so the /dev/ksyms character device is a read-only window into a snapshot of the kernel symbol table π«Ά. the in-kernel symbol manager was built to be flexible enough to handle many types of symbol tables, but ngl, this device only supports elf(5) symbol tables β that's the only one invited to the party π. the ELF format image it hands you contains two sections: a symbol table and a corresponding string table.
π Symbol Table
the SYMTAB section has all the symbol table entries that are live in the currently running kernel, plus the symbol table entries of any loaded modules β¨. the symbols are ordered by kernel module load time β kernel file symbols come first, then the first loaded module's symbols, and so on down the line. very "first come, first served" of them π«Ά
π§ String Table
the STRTAB section is where the symbol name strings live β from the kernel and from any loaded modules that the symbol table entries point at π¦
Elf formatted symbol table data that you read from /dev/ksyms represents the state of the kernel at the time when the device is opened β°. since /dev/ksyms has no text or data, most of the fields are initialized to NULL β yeah, mostly vibes and NULLs in there π. the ksyms driver does not block modules from being loaded or unloaded while /dev/ksyms is open, but that means it may contain stale data. so likeβ¦ the tea might be a little old by the time you sip it π
ποΈ FILES ποΈ
/dev/ksyms
π ERRORS π
an open(2) of /dev/ksyms will fail if:
[EBUSY]β the device is already open. a process must close/dev/ksymsbefore it can be opened again. one at a time, bestie, it's a single-occupancy situation π[ENOMEM]β there's a resource shortage in the kernel. no memory, no entry, sorry queen π[ENXIO]β the driver was unsuccessful in creating a snapshot of the kernel symbol table. this may happen if the kernel was in the process of loading or unloading a module. bad timing fr fr π
π SEE ALSO π
π HISTORY π
a ksyms device exists in many different operating systems β she's a well-traveled icon π. this implementation is similar in function to the Solaris and NetBSD ksyms driver.
the ksyms driver first appeared in FreeBSD 8.0 to support lockstat(1) β. a whole legend born to help out another tool, we love a supportive bestie π«Ά
π AUTHORS π
the ksyms driver was written by Stacey Son <sson@FreeBSD.org>. thank you for your service, queen π
π BUGS π
because files can be dynamically linked into the kernel at any time, the symbol information can vary π΅π«. when you open the /dev/ksyms file, you get access to an ELF image that represents a snapshot of the state of the kernel symbol information at that instant in time. keeping the device open does not block the loading or unloading of kernel modules. so if you want a new snapshot, you must close and re-open the device. no cap. π₯
a process is only allowed to open the /dev/ksyms file once at a time. the process must close the /dev/ksyms before it is allowed to open it again. one girl at a time, that's the rule π
π«Ά reminder bestie: read-only, one-open-at-a-time, snapshot-only, and no module-blocking. everything else is just vibes. iykyk β¨
this page came from Debian, dated August 2, 2017 β mwah, thanks for the lore drop, sending love to whoever typed it all those years ago ππβ¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2008-2009 Stacey Son <sson@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms