]> granicus.if.org Git - php/commitdiff
Implement #43269: Retrieve FD_SETSIZE within PHP
authorChristoph M. Becker <cmbecker69@gmx.de>
Sun, 3 Jul 2016 12:16:43 +0000 (14:16 +0200)
committerJulien Pauli <jpauli@php.net>
Fri, 8 Jul 2016 13:23:15 +0000 (15:23 +0200)
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.

main/main.c

index 60b8e5911676edcc486554d1fec1fbe01e08bc20..848f24fc5ab5c247de0a4cc7d2436ec8454237e8 100644 (file)
@@ -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);