2025-01-24 Collin Funk <collin.funk1@gmail.com>
+ ptsname_r: Work around ptsname_r bug on Solaris 11 OmniOS.
+ * lib/ptsname_r.c (ptsname_r): Ensure the resulting buffer is not
+ clobbered if it is too small on Solaris 11 OmniOS.
+ * m4/ptsname_r.m4 (gl_FUNC_PTSNAME_R): On Solaris 11 OmniOS, arrange to
+ override ptsname_r.
+ * doc/posix-functions/ptsname_r.texi: Document the bug.
+
strerrorname_np: Work around a bug on Solaris 11 OmniOS.
* m4/strerrorname_np.m4 (gl_CHECK_STRERRORNAME_NP): Test if
strerrorname_np returns NULL when given ERESTART or ESTRPIPE.
@item
When this function fails with ERANGE, it stores an empty string as result
on some platforms:
-NetBSD 10.0.
+NetBSD 10.0, Solaris 11 OmniOS.
@end itemize
Portability problems not fixed by Gnulib:
#undef ptsname_r
{
#if HAVE_ESSENTIALLY_WORKING_PTSNAME_R
-# if defined __NetBSD__
+# if defined __NetBSD__ || defined __sun
char tmpbuf[32];
if (buf == NULL)
return EINVAL;
# ptsname_r.m4
-# serial 10
+# serial 11
dnl Copyright (C) 2010-2025 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl result buffer. We don't use an AC_RUN_IFELSE test here, because
dnl while the bug exists on all platforms, only NetBSD/i386 has the
dnl files /dev/ptyp[01] on which the bug becomes apparent.
+ dnl
+ dnl On Solaris 11 OmniOS the result buffer is clobbered as well.
case "$host_os" in
- netbsd*) REPLACE_PTSNAME_R=1 ;;
+ netbsd* | solaris*) REPLACE_PTSNAME_R=1 ;;
esac
fi
fi