Hi,

Looks like you are trying to find the full paths to the libs used by a running 
process. You can do this with the pldd command:

$ pldd 9528
9528:   bash
/lib/libcurses.so.1
/lib/libsocket.so.1
/lib/libnsl.so.1
/lib/libdl.so.1
/lib/libc.so.1
/platform/sun4u/lib/libc_psr.so.1
/usr/lib/locale/en_US.ISO8859-1/en_US.ISO8859-1.so.3

Is that what you are looking for? If you are trying to create an app to do 
something similiar, you could look at the source for pldd :)
 
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Octave J. Orgeron
Solaris Systems Engineer
http://www.opensolaris.org/os/community/sysadmin/
http://unixconsole.blogspot.com
[EMAIL PROTECTED]
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

----- Original Message ----
From: Joerg Schilling <[EMAIL PROTECTED]>
To: [email protected]
Sent: Wednesday, November 29, 2006 9:52:23 AM
Subject: [osol-discuss] Finding the path for libraries

Is there a way to reliably retrieve the path to a library?

I tried to opendir("/proc/<pid>/path/")
and readdir()/readlink() the entries. If all library 
names differ, this allows to find the path to any lib of
interest.

Unfortunately, this does not help if there are two 
libraries with the same name (e.g. /tmp/libm.so.2
and /lib/libm.so.2). Is there a way to get the 
path that is related to a handle returned by dlopen()?

Jörg

-- 
 EMail:[EMAIL PROTECTED] (home) Jörg Schilling D-13353 Berlin
       [EMAIL PROTECTED]                (uni)  
       [EMAIL PROTECTED]     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily
_______________________________________________
opensolaris-discuss mailing list
[email protected]





 
____________________________________________________________________________________
Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited
_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to