Subject: Re: __progname (was Re: audit of syslog(3) usage...)
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Johan Danielsson <>
List: tech-userlevel
Date: 01/26/2001 23:15:14
der Mouse  <mouse@Rodents.Montreal.QC.CA> writes:

> 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

I think the original idea was to include two functions `getprogname',
and `setprogname', where the former would (on NetBSD) just return
__progname, and the latter either do nothing, or set __progname to the
passed string.

The reason to include a `setprogname' is that you want to get this
reasonably portable to systems that doesn't have a __progname
variable. You should check out crypto/dist/heimdal/lib/roken/warnerr.c
for a likely implementation.