OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Subject: Re: When argv[0] == NULL ...
From: Daniel Jacobowitz (dmj+andrew.cmu.edu)
Date: Tue Sep 12 2000 - 19:28:17 CDT


On Wed, Sep 13, 2000 at 11:19:39AM +1100, Tim Robbins wrote:
> Not all programs die while trying to manipulate argv[0], some just do very
> strange things (atd, ftpd). BSD has a `progname' global variable that
> always contans the name of the current program, snd I think something
> similar would be good for Linux, too.

I think there is, now - it's undocumented, and doesn't appear in any of
the header files, but glibc 2.1 export __progname and __progname_full.
I don't know if these are set in any reliable way, though.

Dan

/--------------------------------\ /--------------------------------\
| Daniel Jacobowitz |__| SCS Class of 2002 |
| Debian GNU/Linux Developer __ Carnegie Mellon University |
| dandebian.org | | dmj+andrew.cmu.edu |
\--------------------------------/ \--------------------------------/