1
0
mirror of https://github.com/php/php-src.git synced 2026-03-31 12:42:29 +02:00

BSD4.1 (possibly others) doesn't support _SC_TTY_NAME_MAX

This commit is contained in:
Sara Golemon
2007-01-05 20:01:44 +00:00
parent b39fc244f0
commit 925cbe4cfe

View File

@@ -575,7 +575,12 @@ PHP_FUNCTION(posix_ttyname)
fd = Z_LVAL_PP(z_fd);
}
#if HAVE_TTYNAME_R
#ifdef _SC_TTY_NAME_MAX
buflen = sysconf(_SC_TTY_NAME_MAX);
#else
/* Arbitrary buffer size for systems which don't extrospect their tty name lengths, way overkill */
buflen = 64;
#endif
p = emalloc(buflen);
if (ttyname_r(fd, p, buflen)) {