Functions

whoami.c File Reference

GIS Library - Login name functions. More...

#include <unistd.h>
#include <stdlib.h>
#include <pwd.h>
#include <grass/gis.h>
Include dependency graph for whoami.c:

Go to the source code of this file.

Functions

char * G_whoami (void)
 Gets user's name.

Detailed Description

GIS Library - Login name functions.

(C) 2001-2008 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author:
GRASS GIS Development Team
Date:
1999-2008

Definition in file whoami.c.


Function Documentation

char* G_whoami ( void   )

Gets user's name.

Returns a pointer to a string containing the user's login name.

Tries getlogin() first, then goes to the password file. However, some masscomp getlogin() fails in ucb universe because the ttyname(0) rotuine fails in ucb universe. So we check for this, too.

Return values:
char* Pointer to string

Definition at line 40 of file whoami.c.

References G_store(), name, and NULL.

Referenced by G_short_history().