[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: getprogname
From: |
Bruno Haible |
Subject: |
Re: getprogname |
Date: |
Tue, 10 Jan 2006 22:17:10 +0100 |
User-agent: |
KMail/1.5 |
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
http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/gen/getprogname.c?rev=1.4&content-type=text/x-cvsweb-markup
http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/gen/setprogname.c?rev=1.8&content-type=text/x-cvsweb-markup
and NetBSD
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/gen/getprogname.c?rev=1.3&content-type=text/x-cvsweb-markup
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/gen/setprogname.c?rev=1.3&content-type=text/x-cvsweb-markup
is just the opposite: Whatever may the initial value of __progname be,
it is erased when setprogname is called.
Which is also reasonable: you want to allow an application to override
system behaviour, not the other way around.
> LibGW32C-0.3 has getexecname (see
> <http://sourceforge.net/project/shownotes.php?release_id=154242>), so
> that function is not unique to Solaris.
And LibGW32C-0.4 (see http://gnuwin32.sourceforge.net/packages/libgw32c.htm)
has apparently renamed this function to getprogname(). While _not_ providing
a setprogname().
> Surely you meant base_name rather than basename?
What I presented was only a sketch. Let's discuss details when I show
the real code.
> How about something like this instead?
It's missing the removal of the dirname, of "-" and of "lt-". Also,
it lacks a setprogname() function if the system provides getprogname()
but not setprogname().
Bruno
- Re: use of program_name, (continued)
- Re: use of program_name, Dave Love, 2006/01/06
- Re: [bug-gnulib] Re: use of program_name, Bruno Haible, 2006/01/09
- use of -fno-common on Darwin (was: use of program_name), Ralf Wildenhues, 2006/01/09
- Re: use of -fno-common on Darwin, Peter O'Gorman, 2006/01/09
- Re: use of -fno-common on Darwin, Paul Eggert, 2006/01/09
- Re: use of -fno-common on Darwin, Bob Friesenhahn, 2006/01/10
- Re: use of -fno-common on Darwin, Bruno Haible, 2006/01/10
- Re: use of -fno-common on Darwin, Peter O'Gorman, 2006/01/10
- Re: getprogname, Bruno Haible, 2006/01/10
- Re: getprogname, Paul Eggert, 2006/01/10
- Re: getprogname,
Bruno Haible <=
- Re: getprogname, Paul Eggert, 2006/01/11
- Re: use of -fno-common on Darwin, James Youngman, 2006/01/10
- Re: getprogname, Bruno Haible, 2006/01/11
- Re: getprogname, Paul Eggert, 2006/01/11
- Re: [bug-gnulib] Re: use of program_name, Bruno Haible, 2006/01/09
- Re: use of program_name, James Youngman, 2006/01/05
- Re: [bug-gnulib] Re: use of program_name, Bruno Haible, 2006/01/09
- Re: [bug-gnulib] Re: use of program_name, James Youngman, 2006/01/09
- Re: use of program_name, Dave Love, 2006/01/05
- Re: [bug-gnulib] Re: use of program_name, Bruno Haible, 2006/01/09