Hash :
b5b92d84
Author :
Date :
2012-10-02T12:22:19
ptsname: reject invalid file descriptors POSIX left errno undefined on ptsname() failure, although there has at least been an effort to specify reasonable values to use: http://www.austingroupbugs.net/view.php?id=503 However, our tests for ptsname and ptsname_r already require errno to be set to useful values (as in glibc), so it is worth replacing ptsname on FreeBSD 8.2 in order to get better QoI and pass the test. * m4/ptsname.m4 (gl_FUNC_PTSNAME): Probe for FreeBSD bug. * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Add new witness. * modules/stdlib (Makefile.am): Replace witness. * lib/stdlib.in.h (ptsname): Allow for replacement. * modules/ptsname (configure.ac): Trigger replacement. * doc/posix-functions/ptsname.texi (ptsname): Document this.
@node ptsname
@section @code{ptsname}
@findex ptsname
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/ptsname.html}
Gnulib module: ptsname
Portability problems fixed by Gnulib:
@itemize
@item
This function is missing on some platforms:
Mac OS X 10.3, OpenBSD 3.8, Minix 3.1.8, mingw, MSVC 9, BeOS.
@item
This function fails to set errno on failure on some platforms:
FreeBSD 8.2.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
This function is not declared on some platforms:
IRIX 5.3.
@item
On Solaris 11 2010-11, this function fails on all BSD-style @file{/dev/pty*}
device files.
@item
This function is not thread-safe on some platforms:
Cygwin 1.7.9.
Likewise, the gnulib replacement is not thread-safe.
@end itemize
Note that the Gnulib module @code{ptsname_r} is a version of this
function that is more likely to be thread-safe.