On Tue, Apr 26, 2016 at 8:06 PM, Ted Unangst <[email protected]> wrote:
> Gleydson Soares wrote:
>> > what about just printing "doas: "?
>>
>> I prefer not hardcoded string, although I've committed as you pointed out,
>
> getprogname() doesn't seem any more portable than __progname, which is the
> classic means of doing this. It's useful in cases where a program may have
> more than one name, or be called via alias, or what have you. As evidenced by
> the fact that a million programs use it. But...

This is lateral to your main point, but:

IMNSHO, getprogname() should be preferred over __progname, as
functional references can be make relocatable by the tool chain more
easily than data references: __progname results in a copy relocation
(boo hiss) in non-PIE executables.

(That's a general rule for new library interfaces: they should provide
functional interfaces only and never direct data references.)


Philip Guenther

Reply via email to