Open System Services System Calls Reference Manual (G06.28+, H06.05+)

System Functions (f - i) getlogin(2)
NAME
getlogin - Gets login name
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsecsrl
H-series OSS processes: /G/system/zdllnnn/zsecdll
SYNOPSIS
#include <unistd.h>
char *getlogin(void);
DESCRIPTION
The getlogin() function returns the login name associated with the current session.
The login name can be a username or a user alias.
The name is normally associated with a login shell at the time a session is created, and it is inher-
ited by all processes descended from the login shell. (This association is true even if some of
those processes assume another user ID.)
RETURN VALUES
Upon successful completion, the login name is stored in the location pointed to by the returned
value.
If the authentication information for a process is uninitialized, a null string is returned.
RELATED INFORMATION
Functions: geteuid(2), getuid(2).
527186-007 Hewlett-Packard Company 381