This function only exists on a limited number of platforms, so
we add a configure check to make sure it exists.
Gbp-Dch: ignore
_error->Errno("unlockpt", "Unlocking the slave of master fd %d failed!", d->master);
else
{
+#ifdef HAVE_PTS_NAME_R
+ char slave_name[64]; // 64 is used by bionic
+ if (ptsname_r(d->master, slave_name, sizeof(slave_name)) != 0)
+#else
char const * const slave_name = ptsname(d->master);
if (slave_name == NULL)
+#endif
_error->Errno("ptsname", "Getting name for slave of master fd %d failed!", d->master);
else
{
#undef HAVE_SETRESUID
#undef HAVE_SETRESGID
+/* Check for ptsname_r() */
+#undef HAVE_PTSNAME_R
+
/* Define to the size of the filesize containing structures */
#undef _FILE_OFFSET_BITS
AC_SUBST(HAVE_SETRESUID)
AC_SUBST(HAVE_SETRESGID)
+AC_CHECK_FUNC(ptsname_r)
+AC_SUBST(HAVE_PTSNAME_R)
+
dnl Check for doxygen
AC_PATH_PROG(DOXYGEN, doxygen)