Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

getlogin(3) OSS Library Calls Reference Manual
NAME
getlogin - Gets login name
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsecsrl
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zsecdll |
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ysecdll |
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.
If any of these conditions occur, the getlogin( ) function sets errno to the corresponding value:
[ENOMEM] The system was unable to allocate sufficient memory for a control block.
RELATED INFORMATION
Functions: geteuid(2), getuid(2).
STANDARDS CONFORMANCE
The following is an HP extension to the XPG4 Version 2 specification:
The errno value [ENOMEM] can be returned.
376 Hewlett-Packard Company 527187-017