GRASS Programmer's Manual  6.4.2(2012)
gis/whoami.c File Reference
#include <unistd.h>
#include <stdlib.h>
#include <pwd.h>
#include <grass/gis.h>
Include dependency graph for gis/whoami.c:

Go to the source code of this file.

Functions

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

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 gis/whoami.c.

References G_store(), getenv(), name, and NULL.

Referenced by E_edit_history(), G_short_history(), main(), Vect__init_head(), and Vect_hist_command().

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines