getlogin(3)getlogin(3)Namegetlogin - get login name
Syntax
char *getlogin()Description
The subroutine returns a pointer to the login name as found in It may
be used in conjunction with to locate the correct password file entry
when the same userid is shared by several login names.
If is called within a process that is not attached to a typewriter, it
returns NULL. The correct procedure for determining the login name is
to first call and if it fails, to call ( ).
Restrictions
The return values point to static data whose content is overwritten by
each call.
Return Values
Returns NULL (0) if name not found.
Files
/etc/utmp
See Alsogetgrent(3), getpw(3), getpwent(3), utmp(5)getlogin(3)