bug-gnulib
[Top][All Lists]
Advanced

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

Re: getprogname


From: Paul Eggert
Subject: Re: getprogname
Date: Tue, 10 Jan 2006 23:16:40 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Bruno Haible <address@hidden> 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?)




reply via email to

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