On Tue, 19 Apr 2005 10:38:06 -0400, Raymond Toy <[EMAIL PROTECTED]> wrote:

> Uhoh.  CMUCL basically does something like that to find where the
> executable is located so it can locate its core file.  If this is
> not the right way, then CMUCL is doing it wrong.
>
> Do you have a pointer to the "right" way?

I can't find the article anymore but the essence that I remember was
that there is no portable right way... :(

A few things that come to mind:

1. The environment that CMUCL sees (specifically the value of PATH) is
   not necessary the one that was in place when CMUCL was started.

2. You could start CMUCL with execve and feed whatever you want to
   argv[0].

3. How does CMUCL find the core file if there are several hard links
   to the same executable in different directories?

4. Does the procedure which finds CMUCL's core file take into account
   file permissions?  If my PATH is, say "/tmp:/usr/bin" and I have a
   file "lisp" in /tmp then on my Linux machine "lisp" will
   nevertheless invoke /usr/bin/lisp if /tmp/lisp doesn't have the
   right x bit set.

I admit these are all rather theoretical cases but you asked for
it... :)

Cheers,
Edi.


Reply via email to