* doc/posix-functions/getlogin.texi: Document HP-UX 11.11 bug.
* doc/posix-functions/getlogin_r.texi: Likewise.
* tests/test-getlogin_r.c (main): Avoid test failure on HP-UX 11.11.
+2010-12-20 Bruno Haible <bruno@clisp.org>
+
+ getlogin, getlogin_r: Document HP-UX 11.11 bugs.
+ * doc/posix-functions/getlogin.texi: Document HP-UX 11.11 bug.
+ * doc/posix-functions/getlogin_r.texi: Likewise.
+ * tests/test-getlogin_r.c (main): Avoid test failure on HP-UX 11.11.
+
2010-12-20 Bruno Haible <bruno@clisp.org>
getlogin_r: Add missing declaration on HP-UX 11.
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.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
+@item
+This function fails even when standard input is a tty on some platforms:
+HP-UX 11.11.
@end itemize
{
/* Test with a large enough buffer. */
char buf[1024];
+ int err;
- if (getlogin_r (buf, sizeof (buf)) != 0)
+ err = getlogin_r (buf, sizeof (buf));
+ if (err != 0)
{
/* getlogin_r() fails when stdin is not connected to a tty. */
+ ASSERT (err == ENOTTY);
+#if !defined __hpux /* On HP-UX 11.11 it fails anyway. */
ASSERT (! isatty (0));
+#endif
fprintf (stderr, "Skipping test: stdin is not a tty.\n");
return 77;
}