On 01-Apr-2004 Igor Pokrovsky wrote:
| On Wed, Mar 31, 2004 at 02:55:47PM -0500, Mike Heffner wrote:
|> 
|> Is there a method in FreeBSD for a program to retrieve the current list
|> of
|> dynamic shared libraries it is linked against or has dlopen()'d?
| 
| Looks like ldd is doing exactly what you want, take a look at it's
| sources.
| 

Hello, thanks for the response.

The problem I found with ldd was it would only give me the shared objects
linked in at runtime and I needed the list of dlopen()'d objects as well.
On Linux I was able to grab a reference to the link_map list and iterated
through that. Matthew George on the list pointed me to dlinfo(3) which can
return a reference into the link_map list. From my tests this appears to
contain all dlopen()'d libraries as well (also the executable itself,
btw). It also appears to be cleaner than the hack I'm using in Linux to get
the same reference. ;-)


Cheers,

Mike

-- 
  Mike Heffner       <[EMAIL PROTECTED]>
                         <[EMAIL PROTECTED]>

_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to