+2025-03-10 Bruno Haible <bruno@clisp.org>
+
+ getlogin, getlogin_r: Document limitation.
+ Reported by Nicolas Boos <nicolas.boos@wanadoo.fr> in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2025-03/msg00033.html>.
+ * doc/posix-functions/getlogin.texi: Mention the "different user names
+ with same uid" limitation.
+ * doc/posix-functions/getlogin_r.texi: Likewise.
+
2025-03-09 Bruno Haible <bruno@clisp.org>
getlogin_r: Work around musl bug.
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:
+This function returns the value of the @env{LOGNAME} environment variable
+and this therefore arbitrarily fakeable:
musl libc 1.2.5.
@end itemize
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
@code{ERANGE}, when the buffer is not large enough, on some platforms:
macOS 14.
@item
-This function returns the value of the @env{LOGNAME} environment variable:
+This function returns the value of the @env{LOGNAME} environment variable
+and this therefore arbitrarily fakeable:
musl libc 1.2.5.
@end itemize
some platforms:
@c https://dev.haiku-os.org/ticket/18349
Haiku.
+@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