FreeBSD: Add support for showing process emulation

This displays the same output as ps's -o emul, which is the system call
emulation environment, or ABI, in use. This will typically be FreeBSD
ELF32 or ELF64, but can also be Linux ELF32 or Linux ELF64 when running
Linux binaries under FreeBSD's Linuxulator binary compatibility layer.
The column width of 16 is chosen to match KI_EMULNAMELEN's value of 16,
most of which is normally used up as FreeBSD ELF32/64 is 13 characters.
This commit is contained in:
Jessica Clarke
2022-01-15 02:27:53 +00:00
committed by BenBE
parent 4a664c0df8
commit 9512fd7930
4 changed files with 10 additions and 0 deletions

View File

@ -549,6 +549,8 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) {
}
}
free_and_xStrdup(&fp->emul, kproc->ki_emul);
// from FreeBSD source /src/usr.bin/top/machine.c
proc->m_virt = kproc->ki_size / ONE_K;
proc->m_resident = kproc->ki_rssize * pageSizeKb;