GETLOGIN(3C) UNIX Programmer's Manual GETLOGIN(3C) NAME getlogin - get login name SYNOPSIS char *getlogin ( ); HP-UX COMPATIBILITY Level: HP-UX/NUCLEUS Origin: System III DESCRIPTION _G_e_t_l_o_g_i_n returns a pointer to the login name as found in /etc/utmp. It may be used in conjunction with _g_e_t_p_w_n_a_m to locate the correct password file entry when the same user ID is shared by several login names. If _g_e_t_l_o_g_i_n is called within a process that is not attached to a terminal, it returns NULL. The correct procedure for determining the login name is to call _c_u_s_e_r_i_d, or to call _g_e_t_l_o_g_i_n and if it fails, to call _g_e_t_p_w_u_i_d. FILES /etc/utmp SEE ALSO cuserid(3S), getgrent(3C), getpwent(3C), utmp(5). DIAGNOSTICS _G_e_t_l_o_g_i_n returns NULL if the name is not found. BUGS The return values point to static data whose content is overwritten by each call.