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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user