Date: Sun, 18 Jan 1998 14:23:59 -0800 From: Amancio Hasty <hasty@rah.star-gate.com> To: Terry Lambert <tlambert@primenet.com> Cc: jdp@polstra.com, hackers@FreeBSD.ORG Subject: Re: dladdr hax Message-ID: <199801182223.OAA19901@rah.star-gate.com> In-Reply-To: Your message of "Sun, 18 Jan 1998 22:14:28 GMT." <199801182214.PAA04062@usr04.primenet.com>
next in thread | previous in thread | raw e-mail | index | archive | help
{hasty} pwd
/usr/home/hasty
{hasty} ./test
argv[0] ./test
getcwd /usr/home/hasty
{hasty} /tmp/test
argv[0] /tmp/test
getcwd /usr/home/hasty
Now it looks to me that we have enough information to reconstruct the
the execution path. If "test" is a symlink we should be able to
follow the symlink provided that thats what we want.
Enjoy,
Amancio
> > > > Thats an interesting approach so what happens to a vnode of a
> > > > running executable when is mark for delete? I kind doubt that the
> > > > vnode goes away while the image is still executing 8)
> > >
> > > Of course not. But there is no longer a pathname for it.
>
> Actually, there is; it's in /proc. 8-). I kind of doubt that
> Classes.zip is located relative to /proc, however. 8-(.
>
>
> > So whats wrong with just simply calling getwcd in the main of the
> > program?
> >
> > That should get us the current working directory which is what is
> > needed by java to locate its class libraries.
>
> Because it will return the directory name of where you ran it from, not
> the directory name of where the image that is executng is located?
>
> 8-) 8-).
>
> The classes are located relative to the image, not relative to where
> the image was run from...
>
>
> The real PITA here is that most of the kludge workarounds being discussed
> will not allow the creation of a correct JRE for a java applet that is
> being run by an execution class loader from the kernel. So they aren't
> even good workarounds, since they preclude future work. And that's a
> bad thing.
>
>
> Terry Lambert
> terry@lambert.org
> ---
> Any opinions in this posting are my own and not those of my present
> or previous employers.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801182223.OAA19901>
