This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: getprogname / setprogname
- From: "H. J. Lu" <hjl at lucon dot org>
- To: Robert Millan <rmh at aybabtu dot com>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Fri, 17 Mar 2006 06:39:17 -0800
- Subject: Re: getprogname / setprogname
- References: <20060317143528.GA29360@localhost.localdomain>
On Fri, Mar 17, 2006 at 03:35:28PM +0100, Robert Millan wrote:
>
> Hi!
>
> How would you feel about adding getprogname / setprogname ?
>
> They're very simple: setprogname writes to a char pointer and getprogname
> reads from it. Optionaly, startup routines might call "setprogname (argv[0])".
>
> The idea is that programs can find their own name outside of main(), see:
>
> http://www.freebsd.org/cgi/man.cgi?query=getprogname
>
Since we are on this topic, sometimes, I want to know the real pathname
of the program. It isn't easy to find it out.
H.J.