1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-18 23:42:00 +03:00

getlogin_r: Work around portability problem on OSF/1.

* m4/getlogin_r.m4 (gl_FUNC_GETLOGIN_R): Detect the OSF/1 problem.
* lib/unistd.in.h (getlogin_r): Replace if REPLACE_GETLOGIN_R is set.
* lib/getlogin_r.c (getlogin_r): When getlogin_r exists, invoke it and
test for a truncated result.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize REPLACE_GETLOGIN_R.
* modules/unistd (Makefile.am): Substitute REPLACE_GETLOGIN_R.
* modules/getlogin_r (Depends-on): Add memchr.
* doc/posix-functions/getlogin_r.texi: Mention the OSF/1 problem.
This commit is contained in:
Bruno Haible
2010-12-22 19:25:34 +01:00
parent f7fecbfc47
commit e53e23a012
8 changed files with 92 additions and 5 deletions

View File

@@ -18,6 +18,10 @@ HP-UX 11.
@item
This function has an incompatible declaration on some platforms:
Solaris 11 2010-11 (when @code{_POSIX_PTHREAD_SEMANTICS} is not defined).
@item
This function returns a truncated result, instead of failing with error code
@code{ERANGE}, when the buffer is not large enough, on some platforms:
OSF/1 5.1.
@end itemize
Portability problems not fixed by Gnulib: