Date: Thu, 21 Feb 2002 17:17:33 -0600 From: "Mike Meyer" <mwm-dated-1014765454.b98691@mired.org> To: Haryadi Gunawi <haryadi@cs.wisc.edu> Cc: questions@freebsd.org Subject: Re: /proc/pid/map (freeBSD vs Linux) Message-ID: <15477.32781.764487.999101@guru.mired.org> In-Reply-To: <4555239@toto.iv>
next in thread | previous in thread | raw e-mail | index | archive | help
Haryadi Gunawi <haryadi@cs.wisc.edu> types: > Here is my project in detail. > - I have a PID (from getpid) > - Then I want to look what program has that PID (by looking at the > /proc/pid/map) > - next I must know what libraries are utilized, and their text segments > (where the code are allocated) > Now the problem is: > I don't know what is the executable name, and the > libraries utilized from /proc/pid/map in FreeBSD. > In Linux I can easily get them from the last column. > Where can I get those names in FreeBSD? /proc/pid/file is a symlink to the executable. If the executable isn't there any more, it just says "unknown". > I assume the numbers in the third column (1, 12, 57) mean something, but > I don't know what they are. The source is in /usr/src/sys/miscfs/procfs/procfs_map.c. These lines are describing objects in the VM system. The name of the file associated with that segment of memory is no longer in the kernel. It should be possible to grovel the library name out of that segment of the processes memory. Getting the full path name may be impossible. <mike -- Mike Meyer <mwm@mired.org> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15477.32781.764487.999101>