emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding the dump


From: Eli Zaretskii
Subject: Re: Finding the dump
Date: Sat, 02 Feb 2019 09:22:59 +0200

> From: Richard Stallman <address@hidden>
> Cc: address@hidden, address@hidden, address@hidden,
>       address@hidden, address@hidden
> Date: Fri, 01 Feb 2019 22:25:50 -0500
> 
>   > I would suggest to use another word instead of "should".  Using
>   > argv[0] has its drawbacks, e.g., if the string there neither has a
>   > slash nor is a file found along PATH -- this could happen when a
>   > program is invoked via a symlink
> 
> How so?  I don't see how this could happen.  If the symlink was found
> in PATH to run the program, it should be there when the program looks
> for it, except in the case where it was deleted or renamed in the mean
> time.

I mean the case where a symlink is to an explicit absolute file name,
and the related files can be found only if you know the target of the
symlink.  But AFAIK argv[0] will not give you the resolved target file
name, it will give you the symlink name.

>                                    or some other method, or because the
>   > calling program puts there something unrelated to where the executable
>   > lives.
> 
> Yes, that can happen, but I think that is an error on the caller's
> part.  Anyway, there is no other portable method besides argv[0].  I
> don't know whether we want to assume that all kernels for GNU will
> support /proc/self.

Maybe so, but still, saying "should" can be interpreted to mean any
other method is discouraged, which I don't think is the case.  I think
this text wants to make a point that in this case it is OK to use
argv[0], unlike when it is used to change the behavior of the program
in some fundamental way.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]