Subject: Re: __progname (was Re: audit of syslog(3) usage...)
To: None <>
From: Greg A. Woods <>
List: tech-userlevel
Date: 01/26/2001 15:11:53
[ On Sunday, January 21, 2001 at 20:02:07 (-0500), der Mouse wrote: ]
> Subject: __progname (was Re: audit of syslog(3) usage...)
> > 	- On a tangental point, if we get around to replacing
> > 		const char *__progname
> > 	  with something more portable like: 
> > 		const char *getprogname(const char *argv0)
> I would hope not.  Speaking with my application-author hat on, one of
> the biggest wins of __progname is that it *doesn't* require me to
> preserve argv[0] from main down to the usage point (which usually means
> either a shared global or an extra argument down through the call
> chain, the latter sometimes bordering on impossible).  It's nice enough
> that I even went to the trouble to produce a localized crt0 with
> __progname on the SunOS machines I have occasion to build code on.

Well, as an application author who pays a great deal of attention to
portability I can say authoritatively that __progname is totally useless
to me -- it is not portable and probably never will be.  I always
preserve my own argv[0] in my own global variable (and I've been calling
it "argv0" for over a decade).

Unfortunately not all application programmers are so keen to keep *all*
of the code they work with as totally portable as I am.

This is the kind of thing that makes non-technical managers cringe at
the horrible differences between the many variants of Unix-like
systems.  To us programmer's they're really all the same, but to someone
who sees us spend even an hour hacking on code from one variant to make
it work on another they are vastly different and thus they think they
have to decide on which is best and hope that in the long run all the
other managers make the same decision so that this one variant wins
market dominance and wipes all the other variants to oblivion.  Witness
the recent issue of "Server/Workstation Expert" where there are cartoons
showing a penguin with a tie on selling his wares to a bunch of suits in
a boardroom, and another with a penguin baby causing fright to a suit
with a "microsoft" briefcase and a techie with a "unix" team jacket.

In my dreams I wish that *BSD would stick to using just and only the
Single Unix Specification for internal code (except of course where
truly low-level kernel interfaces are hidden within) as well as offering
it as an API.

							Greg A. Woods

+1 416 218-0098      VE3TCP      <>      <robohack!woods>
Planix, Inc. <>; Secrets of the Weird <>