diff options
author | Bruno Haible <bruno@clisp.org> | 2010-12-22 17:09:26 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2010-12-22 17:09:26 +0100 |
commit | b34e3963935bb561dc2a4ab29477722ac03da164 (patch) | |
tree | 670748b221e40066f3631b2f9355522e02281c2d /lib/ttyname_r.c | |
parent | 132c6a6ce406bec92f2df601cec19d603108bac6 (diff) | |
download | gnulib-b34e3963935bb561dc2a4ab29477722ac03da164.tar.gz |
ttyname_r: Work around bug on OSF/1 5.1.
* doc/posix-functions/ttyname_r.texi: Mention the OSF/1 bug.
* m4/ttyname_r.m4 (gl_FUNC_TTYNAME_R): Detect the OSF/1 bug. Say "no"
instead of "guessing no" when the OSF/1 bug or the Solaris bug is
present.
* lib/ttyname_r.c (ttyname_r): Update comments.
Diffstat (limited to 'lib/ttyname_r.c')
-rw-r--r-- | lib/ttyname_r.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ttyname_r.c b/lib/ttyname_r.c index 5b59547cad..1836415ace 100644 --- a/lib/ttyname_r.c +++ b/lib/ttyname_r.c @@ -32,8 +32,9 @@ ttyname_r (int fd, char *buf, size_t buflen) /* When ttyname_r exists, use it. */ #if HAVE_TTYNAME_R /* This code is multithread-safe. */ - /* On Solaris, ttyname_r always fails if buflen < 128. So provide a buffer - that is large enough. */ + /* On Solaris, ttyname_r always fails if buflen < 128. On OSF/1 5.1, + ttyname_r ignores the buffer size and assumes the buffer is large enough. + So provide a buffer that is large enough. */ char largerbuf[512]; # if HAVE_POSIXDECL_TTYNAME_R int err = |