Technical data

ksyms(7D) Devices SunOS 5.5
Avoid keeping the /dev/ksyms file open for extended periods of time, either by using
kvm_open(3K) of the default namelist file or with a direct open. There are two reasons
why you should not hold /dev/ksyms open. First, the system’s ability to dynamic
configure itself is partially disabled by the locking down of loaded modules. Second, the
snapshot of symbol information held by you will not reflect the symbol information of
modules loaded after your initial open of /dev/ksyms.
Note that the ksyms driver is a loadable module, and that the kernel driver modules are
only loaded during an open system call. Thus it is possible to run stat(2) on the
/dev/ksyms file without causing the ksyms driver to be loaded. In this case, the file size
will appear to be zero. A workaround for this behavior is to first open the /dev/ksyms
file, causing the ksyms driver to be loaded (if necessary). You can then use the file
descriptor from this open in a fstat() system call to get the file’s size.
NOTES The kernel virtual memory access library (libkvm) routines use /dev/ksyms as the
default namelist file. See kvm_open(3K) for more details.
The /dev/ksyms ELF image can be mapped into a process’s address space. See mmap(2)
for details.
7D-182 modified 10 Sep 1994