@node getlogin
@subsection @code{getlogin}
@findex getlogin

POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9799919799/functions/getlogin.html}

Gnulib module: getlogin
@mindex getlogin

Portability problems fixed by Gnulib:
@itemize
@item
This function is missing on some platforms:
older mingw, MSVC 14.
@item
This function is not declared unless @code{_POSIX} is defined on some platforms:
mingw.
@item
This function returns the value of the @env{LOGNAME} environment variable
and is therefore arbitrarily fakeable:
musl libc 1.2.5.
@end itemize

Portability problems not fixed by Gnulib:
@itemize
@item
This function returns an empty string even when standard input is a tty
on some platforms:
HP-UX 11.11.
@item
When there are several user names with the same user ID,
this function may return, instead of the user name that logged in,
another user name that has the same user ID, on some platforms:
Linux and others.
@end itemize
