From: Christoph M. Becker Date: Sun, 3 Jul 2016 12:16:43 +0000 (+0200) Subject: Implement #43269: Retrieve FD_SETSIZE within PHP X-Git-Tag: php-7.1.0beta1~146 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=10e824808259dedf537ededabb9812dcae5785b5;p=php Implement #43269: Retrieve FD_SETSIZE within PHP To give userland developers who work with large numbers of file descriptors the opportunity to avoid problems on systems which may not support that many descriptors (e.g. when calling socket_select()), we make FD_SETSIZE available in PHP as PHP_FD_SETSIZE. --- diff --git a/main/main.c b/main/main.c index 60b8e59116..848f24fc5a 100644 --- a/main/main.c +++ b/main/main.c @@ -2177,6 +2177,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod REGISTER_MAIN_LONG_CONSTANT("PHP_INT_MAX", ZEND_LONG_MAX, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_LONG_CONSTANT("PHP_INT_MIN", ZEND_LONG_MIN, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_LONG_CONSTANT("PHP_INT_SIZE", SIZEOF_ZEND_LONG, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("PHP_FD_SETSIZE", FD_SETSIZE, CONST_PERSISTENT | CONST_CS); #ifdef PHP_WIN32 REGISTER_MAIN_LONG_CONSTANT("PHP_WINDOWS_VERSION_MAJOR", EG(windows_version_info).dwMajorVersion, CONST_PERSISTENT | CONST_CS);