Re : Getting path of a shared object from inside it

From: Jean-Claude Arbaut (jean-claude.arbaut_at_laposte.net)
Date: 06/21/05


Date: Tue, 21 Jun 2005 14:43:55 +0200


On 21/06/2005 14:40, sug wrote:

> Hi,
>
> I am running a C program on Unix which loads a shared object of mine.
>
> I need to get the path of my .so from inside it. I want to do this
> because from my .so I want to open a text file which is in same
> directory as my .so.
>
> getcwd() obviously doesn't serve my purpose because my .so is not in
> "cwd" but I am pointing my executable to it using the
> LIBPATH/LD_LIBRARY_PATH.
>
> Can somebody provide any pointers? Thanks in advance
>
>
> Sug
>



Relevant Pages