[GRASS5] cuserid alternative?

William K woklist at charter.net
Sun Aug 1 23:31:03 EDT 2004

> In all probability, db_whoami() (and, for that matter, G_whoami())
> should be using getenv("LOGNAME") rather than either cuserid() or
> getlogin().
So, could this be changed in the source?  Didn't think to search for 
'whoami' (doh!), just db_whoami.  Hmm, looks like G_whoami() uses 
getlogin().  So, is there any point to db_whoami?

>> FYI, this is my new whoami.c (let me know if anything is wrong with 
>> it):
>> char *
>> db_whoami()
>> {
>>      char *getlogin();
> Don't provide your own prototypes for library functions; include the
> appropriate header instead.
Yep, my lack of C skill shows here.  Just mimicking the cuserid version 
of db_whoami.

William Kyngesburye <kyngchaos at charter.net>

Earth: "Mostly harmless"

- revised entry in the HitchHiker's Guide to the Galaxy

More information about the grass-dev mailing list