From owner-freebsd-questions Wed Feb 20 21:42:36 2002 Delivered-To: freebsd-questions@freebsd.org Received: from claven.cs.wisc.edu (claven.cs.wisc.edu [128.105.6.18]) by hub.freebsd.org (Postfix) with ESMTP id 263EA37B402 for ; Wed, 20 Feb 2002 21:42:33 -0800 (PST) Received: from nova11.cs.wisc.edu (nova11.cs.wisc.edu [128.105.119.111]) by claven.cs.wisc.edu (8.9.2/8.9.2) with ESMTP id XAA09684 for ; Wed, 20 Feb 2002 23:42:32 -0600 (CST) Received: from localhost (haryadi@localhost) by nova11.cs.wisc.edu (8.9.2/8.9.2) with ESMTP id XAA16669 for ; Wed, 20 Feb 2002 23:42:32 -0600 (CST) X-Authentication-Warning: nova11.cs.wisc.edu: haryadi owned process doing -bs Date: Wed, 20 Feb 2002 23:42:32 -0600 (CST) From: Haryadi Gunawi To: freebsd-questions@freebsd.org Subject: /proc/pid/map (freeBSD vs Linux) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > From: Roman Neuhauser > Subject: Re: /proc/pid/map (freeBSD vs Linux) > Message-ID: <20020220142036.GL418@roman.mobil.cz> > I don't know if this is what you're looking for, but ldd(1) might > help(?). -- Thanks for the answer, ldd is not really what I'm looking for. 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) So looking at the /proc/pid/map (just the text segments, identified by 'r-x' mode): In FreeBSD: 0x8048000 0x8049000 1 0 0xc8776d20 r-x 2 0 0x0 COW NC vnode 0x28049000 0x2805a000 12 0 0xc03f9f80 r-x 73 34 0x0 COW NC vnode 0x28065000 0x280e5000 57 0 0xc03fad60 r-x 73 34 0x0 COW NC vnode In Linux: 8048000-08049000 r-xp 00000000 03:08 22408 /rdata/src/test/loop/a.out 40000000-40016000 r-xp 00000000 03:08 44178 /lib/ld-2.1.92.so 40022000-4013d000 r-xp 00000000 03:08 44185 /lib/libc-2.1.92.so I know the first one is the executable itself, the 2nd one should be the dynamic linker, and the third one is the C library. The first and 2nd column are the starting and ending text/code segment. 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? I assume the numbers in the third column (1, 12, 57) mean something, but I don't know what they are. Thank you very much, appreciate your time, hg To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message