GETLOGIN(3C) COMMAND REFERENCE GETLOGIN(3C)
NAME
getlogin - get loginname
SYNOPSIS
char *getlogin()
DESCRIPTION
Getlogin returns a pointer to the loginname as found in
/etc/utmp. It may be used in conjunction with getpwnam to
locate the correct password file entry when the same user ID
is shared by several loginnames.
If getlogin is called within a process that is not attached
to a typewriter, it returns NULL. The correct procedure for
determining the loginname is to first call getlogin and if
it fails, to call getpw(getuid()).
FILES
/etc/utmp
DIAGNOSTICS
Returns NULL (0) if name not found.
CAVEATS
The return values point to static data whose content is
overwritten by each call.
SEE ALSO
getgrent(3c), getpw(3c), getpwent(3c), utmp(5).
Printed 10/17/86 1
%%index%%
na:72,60;
sy:132,170;
de:302,772;
fi:1074,66;
di:1140,120;
ca:1260,143;
se:1403,191;
%%index%%000000000118