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), and utmp(5). Printed 3/13/89 1
%%index%% na:360,76; sy:436,262; de:698,944; fi:1642,86; di:1728,164; ca:1892,171; se:2063,223; %%index%%000000000119