Bruno Haible <[EMAIL PROTECTED]> writes:

> Paul Eggert wrote:
>> This isn't as compatible as possible with BSD, as BSD setprogname
>> ignores its argument when the true program name is available from
>> the operating system.
>
> Huh? My reading of the sources of FreeBSD and NetBSD is just the
> opposite: Whatever may the initial value of __progname be, it is
> erased when setprogname is called.

Hmm, no, actually they differ.  NetBSD agrees with me and FreeBSD with
you.  (See the REALLY_SET_PROGNAME macro in the NetBSD
implementation.)  Ouch.

I was assuming NetBSD, since it introduced the feature.  Also,
<http://netbsd.gw.com/cgi-bin/man-cgi?getprogname++NetBSD-current>
says "in NetBSD, calling setprogname() from main() has no effect."

> Which is also reasonable: you want to allow an application to override
> system behaviour, not the other way around.

Since there's conflicting practice we might as well do the reasonable
thing, yes.  (But I wonder why NetBSD went to the trouble of doing it
that way?)


_______________________________________________
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib

Reply via email to