How can I list all loaded libraries of a process in FreeBSD? On Linux I can use /proccat /proc/$pid/mapson Solaris there is plddpldd $pidFor FreeBSD /proc also works:cat /proc/$pid/maphowever, /proc is not mounted by default. As this is used in an autodetection tool on customers' systems, I'm looking for something (tool or file) that works out of the box. I'm assuming there must be an additional interface to process data on FreeBSD because top works even without mounted /proc.
List loaded libraries of a process on FreeBSD
freebsd;dynamic loading;processes
procstat is your friend.You get the info for a specific pid using:procstat -v $pidOr if you want for all processes then simply:procstat -vaIt yields an output like this:$ procstat -v 61303  PID              START                END PRT  RES PRES REF SHD   FL TP PATH61303           0x400000           0x438000 r-x   46   47   2   0 CN-- vn /usr/local/bin/ksh61303           0x638000           0x63c000 rw-    4    4   1   0 CN-- df61303        0x800638000        0x800655000 r-x   29   30 204   0 CN-- vn /libexec/ld-elf.so.161303        0x800655000        0x800675000 rw-   23   23   1   0 CN-- df61303        0x800855000        0x800857000 rw-    2    2   1   0 CN-- df61303        0x800857000        0x8009cd000 r-x  293  329 218 102 CN-- vn /lib/libc.so.761303        0x8009cd000        0x800bcd000 ---    0    0   1   0 CN-- df61303        0x800bcd000        0x800bd9000 rw-   12    0   1   0 C--- vn /lib/libc.so.761303        0x800bd9000        0x800c03000 rw-    8    8   1   0 CN-- df61303        0x801000000        0x801800000 rw-   26   26   1   0 C--- df61303     0x7ffffffdf000     0x7ffffffff000 rw-    3    3   1   0 C--D df61303     0x7ffffffff000     0x800000000000 r-x    1    1 208   0 ---- phYou see the shared libraries (and the binary itself) under PATH