Hmmm... I missed the

extern int main();

Oh, and it works for Mac OS X >= 10.4, so I guess it works for all
BSDs and most POSIX systems.

On Thu, Jan 31, 2008 at 6:11 PM, Jorge Acereda <[EMAIL PROTECTED]> wrote:
> I think this is somewhat portable. Works for me under NetBSD.
>
>  #include <dlfcn.h>
>
>  const char * vm_executable_path(void) {
>         static Dl_info info = {0};
>         if (!info.dli_fname)
>                 dladdr(main, &info);
>         return info.dli_fname;
>
>
> }
>
>
>  On Thu, Jan 31, 2008 at 4:48 AM, Slava Pestov <[EMAIL PROTECTED]> wrote:
>  > Thanks, applied.
>  >
>  >  Any hope that vm_executable_path() will get a proper implementation? It
>  >  is important for deployment.
>  >
>  >  Slava
>  >
>  >
>  >
>  >  Daniel Néri wrote:
>  >  >        Hi,
>  >  >
>  >  > I've ported Factor to NetBSD/i386. The changes can be pulled from
>  >  >
>  >  >     git://mayonnaise.net/factor.git
>  >  >
>  >  > It works on NetBSD 4.0 (the first release to use GCC >= 3.4) or later.
>  >  > The changes also include NetBSD/amd64 support, but I haven't tested
>  >  > that.
>  >  >
>  >  >
>  >  > Best wishes,
>  >  > Daniel
>  >  >
>  >  >
>  >  > 
> -------------------------------------------------------------------------
>  >  > This SF.net email is sponsored by: Microsoft
>  >  > Defy all challenges. Microsoft(R) Visual Studio 2008.
>  >  > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>  >  > _______________________________________________
>  >  > Factor-talk mailing list
>  >  > [email protected]
>  >  > https://lists.sourceforge.net/lists/listinfo/factor-talk
>  >  >
>  >  >
>  >
>  >
>  >  -------------------------------------------------------------------------
>  >  This SF.net email is sponsored by: Microsoft
>  >  Defy all challenges. Microsoft(R) Visual Studio 2008.
>  >  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>  >  _______________________________________________
>  >  Factor-talk mailing list
>  >  [email protected]
>  >  https://lists.sourceforge.net/lists/listinfo/factor-talk
>  >
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to